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

为什么GCC就AC,C++就WA了呢?(代码)请各位高手帮忙指点指点.谢谢

Posted by ACwalker at 2007-08-19 20:02:10 on Problem 2707
#include<stdio.h>
void main()
{
	double c,a,b,m,d,p,t,max,min;
	scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	while(a!=0&&b!=0&&c!=0&&d!=0)
	{
		if(c<d){max=d;min=c;}else {max=c;min=d;}
		if(a<b){t=a;a=b;b=t;}
		m=b;b=max*b/a;
		if(b<=min)p=100*b/m;
		else {b=min;p=100*b/m;}
		if(p<=1.0)p=1.0;
		if(p>=100.0)p=100.0;
		printf("%d%c\n",(int)p,'%');
		scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
	}
}

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