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 WA!!!!!#include<stdio.h> main() { int a[4],sum,i,j,n,k,h; while(1) { scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]); if(a[0]==0&&a[1]==0&&a[2]==0&&a[3]==0) break; else { sum=1080; if(a[0]>=a[1]) sum+=9*(a[0]-a[1]); else sum+=9*(40-a[1]+a[0]); if(a[1]<=a[2]) sum=sum+(a[1]-a[2])*9; else sum=sum+9*(40-a[1]+a[2]); if(a[3]<=a[2]) sum=sum+(a[2]-a[3])*9; else sum=sum+(40+a[2]-a[3])*9; printf("%d\n",sum); } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator