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 |
大虾们帮忙,在ZOJAC的,为什么WA#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator