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

Re:请帮忙看一下我的程序为什么WA

Posted by bigcircle at 2008-10-11 13:24:42 on Problem 2586
In Reply To:请帮忙看一下我的程序为什么WA Posted by:trymj at 2006-03-24 18:25:05
#include<stdio.h>
int main()
{
	long i,max,s,d;
	while(scanf("%ld%ld",&s,&d)==2)
	{
		if(4*s-d<0)
		{
			max=2*(5*s-d);
			if(max<0)
				printf("Deficit\n");
			else
				printf("%ld\n",max);
			goto l;
		}
		if(3*s-2*d<0)
		{
			max=4*(2*s-d);
			if(max<0)
				printf("Deficit\n");
			else
				printf("%ld\n",max);
			goto l;
		}
		if(2*s-3*d<0)
		{
			max=6*(s-d);
			if(max<0)
				printf("Deficit\n");
			else
				printf("%ld\n",max);
			goto l;
		}
		if(s-4*d<0)
		{
			max=3*(s-3*d);
			if(max<0)
				printf("Deficit\n");
			else
				printf("%ld\n",max);
			goto l;
		}
		printf("Deficit\n");
l:;

	}
	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