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

帮我看一下哪有错误!谢谢

Posted by leening at 2005-12-04 17:30:29 on Problem 2304
#include<iostream.h>
#include<math.h>
void main()
{
  int a[4],sum=0; 
  while(true)
  {
    sum=0;
    cin>>a[0];cin>>a[1];cin>>a[2];cin>>a[3];

 
   if((a[0]==0)&&(a[1]==0)&&(a[2]==0)&&(a[3]==0))
    break;
	if(a[1]>a[0])
  {
   sum+=360-(a[1]-a[0])*9+720;
  }
  else
   sum+=abs(a[1]-a[0])*9+720;
  if(a[2]>a[1])
  {
    sum+=(a[2]-a[1])*9+360;
  }
   else
    sum+=360-abs(a[3]-a[2])*9+360;
   if(a[3]>a[2])
   {
     sum+=360-(a[3]-a[2])*9;
   }
   else
     sum+=abs(a[3]-a[2])*9;
cout<<sum<<endl;
  }
}


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