3 2005 25 1855 12 2004 10000
2108 1904 43236HintWe call year Y a leap year only if (Y%4==0 && Y%100!=0) or Y%400==0.
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int t,Y,N;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&Y,&N);
while(1)
{
if((Y%4==0&&Y%100!=0)||(Y%400==0))
{
N--;
}
if(N==0)
break;
Y++;
}
printf("%d\n",Y);
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
HDU-1076-An Easy Task(Debian下水题测试.....)
原文:http://blog.csdn.net/qq_16542775/article/details/46867301