| ||||||||||
| 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 | |||||||||
改两次了,每次都PE,哪个大牛帮我看看是哪的问题啊.#include<stdio.h>
#include<string.h>
int main()
{
int t,i,A[4],p,k;
char str[33];
scanf("%d",&t);
while(t--)
{
scanf("%s",str);
memset(A,0,sizeof(A));
t=1;k=3;
for(i=31;i>=0;i--)
{
if(t==1)p=1;
else p*=2;
t++;
if(str[i]=='1')A[k]+=p;
if(t==9){t=1;p=1;k--;}
}
printf("%d.%d.%d.%d\n",A[0],A[1],A[2],A[3]);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator