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:大虾们帮忙,在ZOJAC的,为什么WA

Posted by javaman at 2005-06-12 16:36:28 on Problem 2105
In Reply To:大虾们帮忙,在ZOJAC的,为什么WA Posted by:sunmoonstar_love at 2005-06-11 22:58:11
如果你要那么做 需要 unsigned long long 


> #include <stdio.h>
> int N,i;
> unsigned a;
> char tmp;
> int main()
> {
>     scanf("%d\n",&N);
>     while(N--)
>     {
>         a = 0;
>         for(i=31; i>=0; i--)
>         {
>             tmp = getchar();
>             if(tmp == '1')
>                 a += 1<<i;
>         }
>         tmp = getchar();
>         printf("%d.%d.%d.%d\n",a>>24,(a>>16)%256,(a>>8)%256,a%256);
>     }    
>     return 0;
> }    

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