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> void main() { int c[33],n,i; char a[33]; int b[4]={0}; scanf("%d",&n); while((n--)!=0) { for(i=0;i<33;i++) { a[i]=getchar(); c[i]=a[i]-'0'; } //for(i=1;i<33;i++) // printf("%d",c[i]); for(i=1;i<33;i++) if(i<9) b[0]+=c[i]*(int)pow(2,(8-i)); else if(i<17&&i>8) b[1]+=c[i]*(int)pow(2,(16-i)); else if(i<25&&i>16) b[2]+=c[i]*(int)pow(2,(24-i)); else if(i<33&&i>24) b[3]+=c[i]*(int)pow(2,(32-i)); for(i=0;i<4;i++) { printf("%d",b[i]); if(i<3) printf("."); b[i]=0; } printf("\n"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator