90分

gigi 2024-09-08 21:52:32 10

#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; } }

{{ vote && vote.total.up }}

共 3 条回复

wc048

#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; } }

wc048
gigi

@root 到底哪有问题😕😭😭😭