| ||||||||||
| 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 | |||||||||
Help?Help?So serious accident!Why wa?高人指教!#include<stdio.h>
int main()
{
__int64 i=1,j,k,sum=0,total=1;char s[32];char c;
while((c=getchar())!='0')
{
s[0]=c;
while((c=getchar())!='\n')
s[i++]=c;
s[i]='\0';
for(j=0;j<i;j++)
{
s[j]-=48;
for(k=0;k<i-j;k++)
{
total*=2;
}
s[j]=s[j]*total-s[j];
/* s[j]=(long int)ldexp((double)s[j],i-j)-s[j];*/
sum+=s[j];
total=1;
}
printf("%I64d\n",sum);
i=1;
sum=0;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator