Run ID:4131
提交时间:2024-08-04 01:39:06
#include <iostream> using namespace std; int main() { int t, n; // 使用cin读取测试用例的数量 cin >> t; while (t--) { // 使用cin读取每个测试用例的年份 cin >> n; // 判断年份是否为闰年 if ((n % 400 == 0) || (n % 4 == 0 && n % 100 != 0)) { // 输出结果,确保没有多余的空格或换行符(除非OJ系统要求) cout << "YES" << endl; } else { // 输出结果 cout << "NO" << endl; } } return 0; }