Run ID:148131

提交时间:2026-02-09 17:14:56

#include <iostream> // 判断是否为闰年 bool isLeapYear(int year) { if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { return true; } return false; } int main() { int T; std::cin >> T; while (T--) { int Y, N; std::cin >> Y >> N; int count = 0; int currentYear = Y; while (count < N) { if (isLeapYear(currentYear)) { count++; if (count == N) { break; } } currentYear++; } std::cout << currentYear << std::endl; } return 0; }