Run ID:4152

提交时间:2024-08-12 01:15:47

#include <iostream> using namespace std; int main() { int t; cin >> t; // 读取样例组数 while (t--) { int n; cin >> n; // 读取年份 // 判断是否是闰年 if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) { cout << "Yes" << endl; // 是闰年,输出Yes } else { cout << "No" << endl; // 不是闰年,输出No } } return 0; }