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 |
Re:Why WA!!!!!In Reply To:Why WA!!!!! Posted by:yuech at 2009-05-30 04:54:33 > #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; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` in counter-clockwise case, you are also supposed to add a positive number; > 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