没明白这个代码的不同,前者是错误的后者是正确的,谢谢!
查看原帖
没明白这个代码的不同,前者是错误的后者是正确的,谢谢!
793776
hellohelenL楼主2023/1/3 11:17
#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	if (n * 3 + 11 > n * 5)
	{
		cout << "Local" << endl;
	}
	else
	{
		cout << " Luogu" << endl;
	}
	return 0;
}
#include<iostream>
using namespace std;
int a;
int main() {
	cin >> a;
	if (a * 5 < a * 3 + 11) {
		cout << "Local" << endl;
	}
	else {
		cout << "Luogu" << endl;
	}
	return 0;
}

2023/1/3 11:17
加载中...