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

AC 50 发帖纪念

Posted by yao503 at 2007-10-09 10:43:50 on Problem 2304
#include "iostream.h"



int main(void)
{
	int degree;
	int a,b,c,d,temp;
	cin>>a>>b>>c>>d;
	while(!(a==0&&b==0&&c==0&&d==0))
	{
		degree=0;
		temp=b-a;
		if (temp<=0)
		{
			temp=-temp;
		}
		else
			temp=40-temp;
		degree+=temp*9;
		temp=c-b;
		if (temp<0)
		{
			temp=40+temp;
		}
		degree+=temp*9;
		temp=d-c;
		if (temp<=0)
		{
			temp=-temp;
		}
		else
			temp=40-temp;
		degree+=temp*9;
		
		
		
		
		degree+=1080;
		cout<<degree<<endl;
		
		
		cin>>a>>b>>c>>d;
		
		
	}
	return 0;
	
	
}

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