问题 R: 鸡尾酒疗法

it2022-05-05  112

#include<bits/stdc++.h> using namespace std; int main() { int a,b,c,d,k,n; double m,x; scanf("%d",&n); scanf("%d%d",&a,&b); m=(double)b/(double)a;//double(a)/double(b); for(int i=2;i<=n;i++){ scanf("%d%d",&c,&d); x=(double)d/(double)c; if(x>=m-0.05&&x<=m+0.05)cout<<"same"<<"\n"; else if(x<m-0.05)cout<<"worse"<<"\n"; else cout<<"better"<<"\n";} return 0; }

  

转载于:https://www.cnblogs.com/5t2y0/p/9240729.html


最新回复(0)