#include using namespace std;
int main() { int n; cin >> n; int cT, cE; cin >> cT >> cE; int cR = (cE * 100) / cT; for (int i = 1; i < n; ++i) { int nT, nE; cin >> nT >> nE; int nR = (nE * 100) / nT; if (nR > cR + 5) { cout << "better" << endl; } else if (cR > nR + 5) { cout << "worse" << endl; } else { cout << "same" << endl; } }
共 3 条回复
#include<bits/stdc++.h> using namespace std; int main() { int i,n; double x,y,a,b; cin>>n; cin>>a>>b; x=b/a; for(i=1;i<n;i++) { cin>>a>>b; y=b/a; if(y-x>0.05) { cout<<"better"<<endl; } else if(x-y>0.05) { cout<<"worse"<<endl; } else cout<<"same"<<endl; } }
@root 到底哪有问题😕😭😭😭