Run ID:65765
提交时间:2024-02-09 19:07:54
#include <iostream> using namespace std; // 判断是否为闰年的函数 bool isLeapYear(int year) { if (year % 4 != 0) { return false; } if (year % 100 != 0) { return true; } if (year % 400 != 0) { return false; } return true; } int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int year; cin >> year; if (isLeapYear(year)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }