提交时间:2025-10-21 21:09:52

运行 ID: 70841

//分享一下bnucude里面的“鸡尾酒疗法”题目的答案。 #include<bits/stdc++.h> using namespace std; int main() { int a,xy,xz; cin>>a; int y,z; double b=0,xb=0; cin>>xy>>xz; xb=xz*1.0/xy; for(int i=1;i<a;i=i+1) { cin>>y>>z; b=z*1.0/y; if(b-xb>0.05) { cout<<"better"<<endl; } else if(b-xb<-0.05){ cout<<"worse"<<endl; } else{ cout<<"same"<<endl; } } return 0; }