Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

结果正确,为啥WA啊?

Posted by D00030 at 2008-04-12 20:19:43 on Problem 2105
#include<stdio.h>
int main()
{
int n1,n2,n3,n4,i,n,b=1;char c[32],a[32],x,y;
scanf("%d",&n);
scanf("%c",&x);
while(b<=n){
for (i=0;i<32;i++)
{scanf("%c",&c[i]);
a[i]=c[i]-48;}
scanf("%c",&y);
n1=a[0]*128+a[1]*64+a[2]*32+a[3]*16+a[4]*8+a[5]*4+a[6]*2+a[7];
n2=a[8]*128+a[9]*64+a[10]*32+a[11]*16+a[12]*8+a[13]*4+a[14]*2+a[15];
n3=a[16]*128+a[17]*64+a[18]*32+a[19]*16+a[20]*8+a[21]*4+a[22]*2+a[23];
n4=a[24]*128+a[25]*64+a[26]*32+a[27]*16+a[28]*8+a[29]*4+a[30]*2+a[31];
printf("%d.%d.%d.%d\n",n1,n2,n3,n4);
b++;
}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator