| ||||||||||
| 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 | |||||||||
测试都过了,但是wa!!!!#include<stdio.h>
#include<string.h>
#include<math.h>
main()
{char a[100];
int i,j,len;
long sum;
for(i=0;strcmp(a,"0")!=0;i++)
{ scanf("%s",a);
sum=0;
len=strlen(a);
for(j=0;j<len;j++)
{sum=sum+(a[j]-'0')*(pow(2,len-j)-1);
}
printf("%ld",sum);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator