Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
拜托了,请大家帮帮忙,为什么老是wa!!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator