| ||||||||||
| 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 | |||||||||
帮我看一下哪有错误!谢谢#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator