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 |
有什么陷阱啊#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator