1 #include<iostream> 2 #include<stdio.h> 3 #include<algorithm> 4 using namespace std; 5 6 int main() 7 { 8 //freopen("acm.acm","r",stdin); 9 int min_ele(int a,int b); 10 //copy(istream_iterator<int>(cin),istream_iterator<int>(),back_inserter(coll)); 11 int a,b,c,d; 12 while(cin>>a>>b>>c>>d) 13 { 14 if(!a&&!b&&!c&&!d) 15 break; 16 17 if(a > b) 18 swap(a,b); 19 if(c > d) 20 swap(c,d); 21 if(a <= c && b <= d) 22 { 23 cout<<100<<"%"<<endl; 24 } 25 else 26 { 27 cout<<min_ele(int(double(c)/double(a)*100),int(double(d)/double(b)*100)); 28 cout<<"%"<<endl; 29 } 30 } 31 } 32 int min_ele(int a,int b) 33 { 34 if(a > b) 35 return b; 36 else 37 return a; 38 }
时间: 2024-11-06 09:49:38