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