您的位置:首页 > 其它

hdu 1076 An Easy Task

2012-04-02 20:38 459 查看
http://acm.hdu.edu.cn/showproblem.php?pid=1076

View Code

#include<iostream>
using namespace std;
bool isleap(int year)
{
if(year%4==0 && year%100!=0) return true;
if(year%400==0) return true;
return false;
}
int main()
{
int t,year,num;
cin>>t;
while(t--)
{
cin>>year>>num;
int count=0;
while(true)
{
if(isleap(year)) count++;
if(count==num) break;
year++;
}
cout<<year<<endl;
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: