菜鸟80求助QAQ

B2065 鸡尾酒疗法

供参考 ```cpp #include <bits/stdc++.h> using namespace std; int main(){ int n; int a,b; double x,y; cin >> n >> a >> b; x = b / (double)a; for (int i = 0;i < n - 1;i ++){ cin >> a >> b; y = (double)b / a; if (y - x > 0.05)cout << "better" << endl; else if(x - y > 0.05)cout << "worse" << endl; else cout << "same" << endl; } } ```
by luogu10086 @ 2023-08-03 15:49:58


|