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> #include <stdlib.h> #include <iostream.h> int main() { int i,j,num=0,n,nb[8] = {128,64,32,16,8,4,2,1}; char sdd[35]; scanf("%d",&n); while(n--) { scanf("%s",sdd); j = 8; for(i = 0; i < j; i++) { num += nb[i%8]*(sdd[i]-'0'); if(i == j-1) { if(j == 32) { //printf("%d\n",num);break; cout << num << endl; } else { //printf("%d",num); //printf("."); cout << num << '.' << endl; num = 0; j = j+8; } } } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator