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 10105 at 2006-03-01 15:35:37 on Problem 1017
#include<iostream>
using namespace std;
void main()
{
	int onNum,twNum,thNum,frNum,fvNum,sxNum;
	int sum=0,a,b,i,j;
	for(;;){
		cin>>onNum>>twNum>>thNum>>frNum>>fvNum>>sxNum;
		if(onNum==0&&twNum==0&&thNum==0&&frNum==0&&sxNum==0)
			break;
		sum = sxNum+fvNum+frNum+(thNum+3)/4;			
		a = 11*fvNum;
		b = 5*frNum;
		i = thNum%4;
		switch(i)
		{
		case 0: break;
		case 3: b += 1;a += 5;break;
		case 2: b += 3;a += 6;break;
		case 1: b += 5;a += 7;break;
		default:break;
		}
		if(b<twNum){
			j = ((twNum-b) + 8) / 9;
			sum += j;
			a += 4 * (j * 9 - (twNum - b));
		}else
			a += 4 * (b - twNum);
		if(a < onNum)
			sum += (onNum - a + 35)/36;
		cout<<sum<<endl;
		 
	}
	 
}








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