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

我的为什么Wa啊,大牛在哪里,帮帮忙罗

Posted by inforyou at 2007-05-11 18:56:37 on Problem 2105
#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:
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