代码如下; #includeusing namespace std; int main() { int n, x1, x2, y1, y2; cin >> n >> x1 >> x2; double x = 1.0 * x2 / x1, y; for (int i = 2; i <= n; i++) { cin >> y1 >> y2; y = 1.0 * y2 / y1; if (y - x > 0.05) cout << "better" << endl; else if (x - y > 0.05) cout << "worse" << endl; else cout << "same" << endl; } return 0; }
考点;无