Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

太怪了,自己电脑编译通过,提交就说有编译错误.......失败

Posted by Nedvid at 2007-12-03 12:47:33 on Problem 2719 and last updated at 2007-12-03 12:48:16
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()//2007.12.2
{
	char a[20];int i,j;
	int sum,n,m;
	while(scanf("%s",a),a[0]!='0')
	{
		sum=0;
		n=strlen(a);
		j=0;
		for(i=n-1;i>=0&&j<n;i--)
		{	
			m=int(a[j]-'0');
		    if(m>=4) m--;
			sum+=m*(int)pow(9.0,i);
			j++;
		}
		printf("%s: %d",a,sum);
	}
	return 1;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator