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

Why WA!!!!!

Posted by yuech at 2009-05-30 04:54:33 on Problem 2304
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator