| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
WA?请帮忙看一下.#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float x1,y1,x2,y2,temp;
cin>>x1>>y1>>x2>>y2;
while(x1||y1||x2||y2)
{
if(x1<y1) {temp=x1;x1=y1;y1=temp;}
if(x2<y2) {temp=x2;x2=y2;y2=temp;}
temp=float(x2/x1)>float(y2/y1)?float(y2/y1):float(x2/x1);
if(temp>=1) temp=1;
else if(temp<0.01) temp=0.01;
cout<<floor(temp*100)<<"%"<<endl;
cin>>x1>>y1>>x2>>y2;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator