1072:鸡尾酒疗法
时间:2024-06-21 16:20
作者:lizq
点击:次
#include bits/stdc++.husing namespace std;int main(){ int n; cinn; int a,b; cinab; double x=1.0*b/a; for(int i=1;in;i++){ int aa,bb; cinaabb; double xx=1.0*bb/aa; if(xx-x0.05) cout"better"endl; else if(x-xx0.05) cout"worse"endl; else cout"s
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a,b;
cin>>a>>b;
double x=1.0*b/a;
for(int i=1;i<n;i++){
int aa,bb;
cin>>aa>>bb;
double xx=1.0*bb/aa;
if(xx-x>0.05) cout<<"better"<<endl;
else if(x-xx>0.05) cout<<"worse"<<endl;
else cout<<"same"<<endl;
}
return 0;
}
(责任编辑:lizq) |