NNFeNN @ 2023-03-27 21:32:18
#include<bits/stdc++.h>
using namespace std;
int a[10005],b[10005];
int main(){
int n;
cin>>n;
cin>>a[1]>>b[1];
double x=1.0*(b[1]/a[1]);
for(int i=2;i<=n;i++){
cin>>a[i]>>b[i];
}
for(int i=2;i<=n;i++){
double y=1.0*(b[i]/a[i]);
if(y-x>0.05){
cout<<"better"<<endl;
}
else {
if(x-y>0.05){
cout<<"worse"<<endl;
}
else{
cout<<"same"<<endl;
}
}
}
return 0;
}
by chaynflow @ 2023-03-27 21:41:46
把你的 a和b 换成 double
by NNFeNN @ 2023-03-27 21:51:16
AC了 感谢!