wsxbm @ 2022-02-07 18:27:23
以下是代码
#include<bits/stdc++.h>
using namespace std;
int n,a,b,f,c,d;
int main(){
cin>>n>>a>>b;
double x=1.0*b/a,y;
for(int i=2;i<=n;i++){
cin>>c>>d;
y=1.0*d/c;
if(y-x>0.05)f=0;
else if(x-y>0.05)f=1;
else if(x==y)f=2;
}
for(int i=2;i<=n;i++){
if(f==0)cout<<"better\n";
else if(f==1)cout<<"worse\n";
else if(f==2)cout<<"same\n";
}
return 0;
}
才10分
by jaco2559 @ 2022-02-07 18:38:46
@wsxbm 您看题了么
by jaco2559 @ 2022-02-07 18:39:32
否则称为效果差不多而不是当x=y是称为差不多
by wsxbm @ 2022-02-08 15:51:15
谢谢大佬指导