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<cstdio> #include<iostream> using namespace std; int main() { int a,b,c,d,i; while(cin >> a >> b >> c >> d) { if(a==0&&b==0&&c==0&&d==0) break; if(a>b) { int t=a; a=b; b=t; } if(c>d) { int t=c; c=d; d=t; } for(i=100;i>=1;i--) { double s=i*1.0/100; double sa,sb; sa=a*s; sb=b*s; if(sa<=c&&sb<=d) { break; } } printf("%d",i); puts("%"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator