| ||||||||||
| 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 | |||||||||
谁能告诉我why错?非常非常非常感谢!!!!!!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator