| ||||||||||
| 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 | |||||||||
觉得很简单。附代码(不需要用gets):#include"stdio.h"
#include"string.h"
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
char a[33],temp[9];
int i,j;
scanf("%s",&a);
j=0;
for(i=0;i<strlen(a);i++)
{
temp[j++]=a[i];
if(j==8)
{
temp[j]='\0';
if(i!=strlen(a)-1)
printf("%d.",strtol(temp,NULL,2));
else
printf("%d\n",strtol(temp,NULL,2));
j=0;
}
}
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator