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

为什么是wrong anser?是不是我理解错题意了?总感觉没那么简单。。

Posted by 90403136 at 2005-12-21 14:30:39 on Problem 1017
#include <stdio.h>

void main()
{
	int a[6];
	int num=0;
	long int sum;
	scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5]);
	while(a[0]!=0||a[1]!=0||a[2]!=0||a[3]!=0||a[4]!=0||a[5]!=0)
	{	
		
		sum=1*1*a[0]+2*2*a[1]+3*3*a[2]+4*4*a[3]+5*5*a[4]+6*6*a[5];
		
		if(sum%(6*6)==0)	num=sum/(6*6);
		else if(sum/36.0>1)	num=sum/(6*6)+1;
		else if(sum/(6*6)<1)	num=1;

		printf("%d\n",num);
		sum=0;
		scanf("%d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5]);
	}
}

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