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 |
太神奇了 ~~~~ 怎么是WA?(知道的,回复一下)#include <stdio.h> main() { int a[8]; int i, j; char b[8]; int temp; int n; scanf("%d%*c", &n); a[0] = 1; for (i=1; i<8; i++) { a[i]= a[i-1]*2; } while (n>0) { n--; for (i=0;i<4; i++) { temp = 0; for (j=0; j<8; j++) { if (i!=3||j!=7) scanf("%c",&b[j]); else scanf("%c%*c", &b[j]); temp +=(b[j]-48)*a[7-j]; } if (i!=3) printf("%d.",temp); else printf("%d\n",temp); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator