60分求助 喵
查看原帖
60分求助 喵
1182672
python18楼主2024/3/28 21:36
#include<bits/stdc++.h>
using namespace std;
int n;
double a,b,k,j,x,y;
int main()
{
	cin>>n;
	cin>>k>>j;
	x=1.0*j/k;
	while(n--)
	{
		cin>>a>>b;
		y=1.0*b/a;
		if((y-x)>0.05)
		{
			cout<<"better"<<endl;
		}
		else if((y-x)<0.05)
		{
			cout<<"worse"<<endl;
		}
		else if((y-x)==0.05)
		{
			cout<<"same"<<endl;
		}
	}
	return 0;
} 

60分求助

谢谢

喵~~

2024/3/28 21:36
加载中...