Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
70841 sh25_wuyy 鸡尾酒疗法 C++ 通过 0 MS 252 KB 453 2025-10-21 21:09:52

Tests(1/1):


//分享一下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; }


测评信息: