Run ID:106625

提交时间:2025-01-16 14:25:51

#include<iostream> #include<bits/stdc++.h> using namespace std; bool Runyear(int y); int main(){ int t = 0; scanf("%d",&t); while(t--){ int y = 0,n = 0; scanf("%d %d",&y,&n); int count = 0; while(1){ if(Runyear(y)){ count++; } if(n == count){ break; } y++; } printf("%d\n",y); } return 0; } bool Runyear(int y){ if(y % 4 == 0 && y % 100 != 0 || y % 400 == 0){ return true; }else{ return false; } }