全same求助><……
查看原帖
全same求助><……
711037
NNFeNN楼主2023/3/27 21:32
#include<bits/stdc++.h>
using namespace std;
int a[10005],b[10005];
int main(){
    int n;
    cin>>n;
    cin>>a[1]>>b[1];
    double x=1.0*(b[1]/a[1]);
    for(int i=2;i<=n;i++){
		cin>>a[i]>>b[i];
	}
	for(int i=2;i<=n;i++){
		double y=1.0*(b[i]/a[i]);
		if(y-x>0.05){
			cout<<"better"<<endl;
		}
		else {
			if(x-y>0.05){
				cout<<"worse"<<endl;
		    }
			else{
				cout<<"same"<<endl;
			}
		}
	}
    return 0;
}
2023/3/27 21:32
加载中...