标签:
#include<cstdio> #include<iostream> bool isleap(int x){ return (x%4 == 0 && x%100 !=0) || x%400 == 0; } int main(void){ int t; scanf("%d",&t); while(t--){ int n,m,count=0;; scanf("%d%d",&n,&m); while(1){ if(isleap(n)){ count++; if(count == m){ printf("%d\n",n); break; } } n+=4-(n%4); } } return 0; }
标签:
原文地址:http://blog.csdn.net/jibancanyang/article/details/44101675