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

Re:请教大家,为什么错误?(有代码)

Posted by akheyun at 2009-01-24 23:28:10 on Problem 2105
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:
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