| ||||||||||
| 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 | |||||||||
Re:请教大家,为什么错误?(有代码)In Reply To:请教大家,为什么错误?(有代码) Posted by:tcxgsy at 2005-10-06 17:35:57 > #include"stdio.h"
> #include"string.h"
> #include"math.h"
>
> void main()
> { char a[33];
> int i,n,b,c;
>
> scanf("%d",&n);
> while(n)
> {
> for(i=0;i<=32;i++)
> scanf("%c",&a[i]);
> b=0;
> for(i=1;i<=32;i++)
> { c=(int)(a[i]-'0');
> if(c==1) if(i%8!=0) b+=pow(2,(8-(i%8)));
> else b+=1;
> if(i%8==0)
> {if(i<=24)
> { printf("%d.",b);
> b=0;
> }
> else printf("%d\n",b);
> }
> }
> n--;
> }
> }
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator