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

水过5000,贴代码

Posted by WFArt_Lee at 2013-06-15 10:30:58 on Problem 2707
#include <iostream>
#include<algorithm>
using namespace std;
int main()
{
	int a,b,c,d;
	while(cin>>a>>b>>c>>d&&a)
	{
		c*=100;
		d*=100;
		if(a>b)
			a^=b^=a^=b;
		if(c>d)
			c^=d^=c^=d;
		int ans=min(c/a,d/b);
		if(ans<100)
			ans=max(ans,1);
		else
			ans=100;
		cout<<ans<<'%'<<endl;
	}
	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