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

谁能告诉我why错?非常非常非常感谢!!!!!!

Posted by y05ww at 2006-10-04 10:33:07 on Problem 1017
#include<iostream.h>
void main()
{
	int n1,n2,n3,n4,n5,n6,num,m=0;
	cin>>n1>>n2>>n3>>n4>>n5>>n6;
	while(!(n1==0&&n2==0&&n3==0&&n4==0&&n5==0&&n6==0))
	{
		num=0;
		num+=n6;
		if(n5>0)
		{
			num+=n5;
			if(n1>=n5*9) n1-=n5*9;
			else n1=0;
		}
		if(n4>0) 
		{
			num+=n4;
			if(n2>=n4*5) n2-=n4*5;
			else 
			{
				n1-=((n4*5-n2)*4);
				n2=0;
			}
		}
		num+=n3/4;
		if(n3%4==0) n3=0;
		else n3=n3%4;
		m=n3*9+n2*4+n1;
		if(m%36==0) num+=m/36;
		else num+=m/36+1;
		cout<<num<<endl;
		cin>>n1>>n2>>n3>>n4>>n5>>n6;
	}
}

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