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?????????????????-------------------post program c++#include<stdio.h> int main() {int a1,a2,a3,a4,a5,a6,na3,na2,pre_na2,pre_na1; while(1){ scanf("%d%d%d%d%d%d",&a1,&a2,&a3,&a4,&a5,&a6); if((a1+a2+a3+a4+a5+a6)==0) break; na3=a3/4; pre_na2=5*a4; pre_na1=11*a5; switch(a3%4) {case 1:pre_na2+=5;pre_na1+=7;break; case 2:pre_na2+=3;pre_na1+=6;break; case 3:pre_na2+=1;pre_na1+=5;break; } if(pre_na2>=a2) {pre_na1+=4*pre_na2; if(pre_na1>=a1) printf("%d\n",a4+a5+a6+na3+1); else printf("%d\n",a4+a5+a6+na3+(a1-pre_na1)/36+1); } else {na2=((a2-pre_na2)/9+1);pre_na1+=4*(9-a2+pre_na2)%9; if(pre_na1>=a1) printf("%d\n",a4+a5+a6+na3+na2); else printf("%d\n",a4+a5+a6+na3+(a1-pre_na1)/36+1); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator