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 paladin at 2007-08-20 15:44:51 on Problem 2105
#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:
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