| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
太怪了,自己电脑编译通过,提交就说有编译错误.......失败#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator