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