求助
查看原帖
求助
893114
denghuolanshan_1004楼主2023/6/18 13:02

全same了。

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main() {
	int n;
	cin>>n;
	n-=1;
	int a,b;
	cin>>a>>b;
	double x=b/a;
	
	for(int i=0;i<n;i++){
		cin>>a>>b;
		double cc=b/a;
		if (cc-x>0.05)cout<<"better"<<endl;
		else if(x-cc>0.05)cout<<"worse"<<endl;
		else cout<<"same"<<endl;
	}
	return 0;
}
2023/6/18 13:02
加载中...