April Fools Day Contest 2021 A. Is it rated - 2

发布时间 2023-10-10 17:02:34作者: zsxuan

询问若干个问题,每个问题用一段字符串表示,存在空格。每个问题一行,对于每个回答,只需要输出 \(NO\)

view1
#include <bits/stdc++.h>
char s[1000005];
void solve(){
	while (fgets(s, 1000005, stdin) != NULL) {
		std::cout << "NO" << std::endl; // fgets 从流中读取,读取失败返回空指针
	}
}
int main() {
	int _ = 1; // std::cin >> _;
	while (_--) {solve();}
	return 0;
}

view2
#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void solve(){
	std::string s;
//	std::getline(std::cin, s);
	while (std::getline(std::cin, s)) {
		std::cout << "NO" << "\n"; //  getline 为标准输入
	}
}
int main() {
	int _ = 1; // std::cin >> _;
	while (_--) {solve();}
	return 0;
}