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 NobleQiao at 2006-02-10 18:59:54 on Problem 2304
#include <stdio.h>
int main()
{
	int s,p1,p2,p3;
	while(scanf("%d %d %d %d",&s,&p1,&p2,&p3)==4)
	{
		if(s==0&&p1==0&&p2==0&&p3==0)
			break;
		int con_clock1=0,clock=0,con_clock2=0,res=0;
		int dia=1080;
		if(p1-s>=0)
			con_clock1=360-(p1-s)*9;
		else
			con_clock1=(p1-s)*9;//1st逆时针
		if(p2-p1<=0)
			clock=360+(p2-p1)*9;
		else
			clock=(p2-p1)*9;//2nd顺时针
		if(p3-p2>=0)
			con_clock2=360-(p3-p2)*9;
		else
			con_clock2=(p3-p2)*9;//3rd逆时针
		res=con_clock1+clock+con_clock2+dia;
		printf("%d\n",res);
	}
	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