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<vector> using namespace std; int main() { vector<int> vi_rate; for(int a,b,c,d;cin>>a>>b>>c>>d&&a&&b&&c&&d;) { int l1,w1,l2,w2; l1=a>b?a:b; w1=a<=b?a:b; l2=c>d?c:d; w2=c<=d?c:d; double r; if(l1<=l2&&w1<=w2) r=100; if(l1>l2&&w1<=w2) r=int((l2*1.0/l1<w1*1.0/w2?l2*1.0/l1:w1*1.0/w2)*100); if(l1<=l2&&w1>w2) r=int((l1*1.0/l2<w2*1.0/w1?l1*1.0/l2:w2*1.0/w1)*100); if(l1>l2&&w1>w2) r=int((l2*1.0/l1<w2*1.0/w1?l2*1.0/l1:w2*1.0/w1)*100); vi_rate.push_back(r); } for(int i=0;i<vi_rate.size();++i) cout<<vi_rate[i]<<"%"<<endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator