help me HELP ME
查看原帖
help me HELP ME
1470725
xuyehua2012楼主2025/1/20 19:51

#include <bits/stdc++.h> using namespace std; int main() { double n,a,b,x; cin >> n; cin >> a >> b; x = b/a1.0; for (int i = 1;i<= n - 1;i++) { int c,d; cin >> c >>d; int x2 = d/c1.0; if (x2 -x > 0.05 ){ cout << "better"; cout << '\n'; } else if (x2-x < 0.05){ cout << "worse"; cout << '\n'; } else{ cout << "same"; cout << '\n'; } } }

#include <bits/stdc++.h> 
using namespace std;
int main()
{
	double n,a,b,x;
	cin >> n;
	cin >> a >> b;
	x = b/a*1.0;
	for (int i = 1;i<= n - 1;i++)
	{
	    int c,d;
		cin >> c >>d;
		int x2 = d/c*1.0;
		if (x2 -x > 0.05 ){
		    cout << "better";
		    cout << '\n';
		}
		else if (x2-x < 0.05){ 
		    cout << "worse";
		    cout << '\n';
		}
		else{ 
		    cout << "same";
		    cout << '\n';
		}
	}
}
2025/1/20 19:51
加载中...