首页 > 其他 > 详细

hdu 1076 水

时间:2015-03-06 17:09:17      阅读:227      评论:0      收藏:0      [点我收藏+]
#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;
}

hdu 1076 水

原文:http://blog.csdn.net/jibancanyang/article/details/44101675

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!