满江红QAQ

B2065 鸡尾酒疗法

lzy13915136909 @ 2024-05-20 21:06:00

本蒟蒻的code......

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a[1005],b[1005];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i]>>b[i];
    for(int i=0;i<n;i++)
    {
        if(a[i]-b[i]>0.05)
            cout<<"better"<<endl;
        else
        {
            if(b[i]-a[i]>0.05)
                cout<<"worse"<<endl;
            else
                cout<<"same"<<endl;
        }
    }
    return 0;
}

来自一个六年级蒟蒻的彷徨


by lzy13915136909 @ 2024-05-23 11:57:33

@Doraemon

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    double t;
    t=(double)b/a;
    for(int i=0;i<n-1;i++)
    {
        cin>>a>>b;
        if((double)b/a-t>0.05)
            cout<<"better"<<endl;
        else
        {
            if(t-(double)b/a>0.05)
                cout<<"worse"<<endl;
            else
                cout<<"same"<<endl;
        }
    }
    return 0;
}
  AC code

by CMZ15079761339 @ 2024-10-04 14:32:30

《题解是当摆设的》


上一页 |