提交时间:2024-11-08 15:28:16

运行 ID: 55795

#include<iostream> using namespace std; int main() { int n; cin>>n; int a[n],b[n]; float k[n]; for(int i=1;i<=n;i++) { cin>>a[i]>>b[i]; k[i]=b[i]*1.0/a[i]; } for(int i=1;i<=n;i++) { //cout<<k[i]<<endl; if(i>=2) { if(k[i]-k[1]>=0.05) { cout<<"better"<<endl; } else if(k[1]-k[i]>=0.05) { cout<<"worse"<<endl; } else { cout<<"same"<<endl; } } } return 0; }