Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:Why WA！！！！！

Posted by yesiam at 2009-05-30 07:12:46 on Problem 2304
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: