欢迎使用本站,预祝练习时长两年半的选手们到成功! [本模块信息来自tem/def/head]

1072:鸡尾酒疗法

时间:2024-06-21 16:20 作者:lizq 点击:
#include bits/stdc++.husing namespace std;int main(){ int n; cinn; int a,b; cinab; double x=1.0*b/a; for(int i=1;in;i++){ int aa,bb; cinaabb; double xx=1.0*bb/aa; if(xx-x0.05) cout"better"endl; else if(x-xx0.05) cout"worse"endl; else cout"s
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int a,b;
    cin>>a>>b;
    double x=1.0*b/a;
    for(int i=1;i<n;i++){
        int aa,bb;
        cin>>aa>>bb;
        double xx=1.0*bb/aa;
        if(xx-x>0.05) cout<<"better"<<endl;
        else if(x-xx>0.05) cout<<"worse"<<endl;
        else cout<<"same"<<endl;
    }
    return 0;
}


(责任编辑:lizq)
    顶一下
    (0)
    0%
    踩一下
    (0)
    0%