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 tcxgsy at 2005-11-09 21:12:00 on Problem 2707
#include"iostream.h"
void main()
{  int a,b,c,d,e,f,temp;
   while(cin>>a>>b>>c>>d&&(a||b||c||d))
   {     if(a<b)  {temp=a;
                   a=b;
				   b=temp;}
          if(c<d) {temp=c;
                   c=d;
				   d=temp;}
		  if(a<=c&&b<=d)
			  cout<<"100%"<<endl;
		  else  if(a<=c)  cout<<d/b<<"%"<<endl;
		           else if(b<=d) cout<<c/a<<"%"<<endl;
				          else { e=c*100/a;f=d*100/b;
						           if(e>f) cout<<f<<"%"<<endl;
								      else cout<<e<<"%"<<endl;
						  }
   }
}

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