Run ID:2638

提交时间:2020-11-27 16:46:12

#include <cstdio> int leapyear(int year) { if(year%4==0 && year%100!=0 || year%400==0) return 1; else return 0; } #include<iostream> using namespace std; int main(){ int y,n,i,t=0; cin>>n; while(n--){ cin>>y>>i; while(t!=i){ if(leapyear(y)){ t++; } y++; } t=0; cout<<y-1<<endl; } }