标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 17145 Accepted Submission(s): 10946
1 #include<math.h> 2 #include<stdio.h> 3 #include<string.h> 4 #include<iostream> 5 #include<algorithm> 6 using namespace std; 7 8 bool judge(int Y) 9 { 10 if( (Y%4==0 && Y%100!=0) || Y%400==0 )return 1; 11 else return 0; 12 } 13 14 int n,y; 15 16 int main() 17 { 18 int t;cin>>t; 19 while(t--) 20 { 21 scanf("%d%d",&y,&n); 22 int i=0; 23 while(1) 24 { 25 26 if(judge(y))i++; 27 if(i==n){printf("%d\n",y);break;} 28 y++; 29 } 30 } 31 return 0; 32 } 33 34 //freopen("1.txt", "r", stdin); 35 //freopen("2.txt", "w", stdout); 36 //**************************************
标签:
原文地址:http://www.cnblogs.com/wmxl/p/4662837.html