很简单的算法基础题...闰年判断以及计算

 #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
//freopen("input.txt","r",stdin);
int year,n;
int count;
int T;
int i;
cin>>T;
while(T--)
{
while(cin>>year>>n)
{
count = ;
for(i = year; ; i++)
{
if((i % == && i % != ) || i % ==)
{
count = ;
break;
}
}
while(count < n)
{
i += ;
if((i % == && i % != ) || i % ==)
count++;
}
cout<<i<<endl;
}
} return ;
}

hdu 1.2.3的更多相关文章

  1. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  2. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  3. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  4. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  5. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  6. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  7. hdu 4481 Time travel(高斯求期望)(转)

    (转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...

  8. HDU 3791二叉搜索树解题(解题报告)

    1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...

  9. hdu 4329

    problem:http://acm.hdu.edu.cn/showproblem.php?pid=4329 题意:模拟  a.     p(r)=   R'/i   rel(r)=(1||0)  R ...

  10. HDU 2586

    http://acm.hdu.edu.cn/showproblem.php?pid=2586 题意:求最近祖先节点的权值和 思路:LCA Tarjan算法 #include <stdio.h&g ...

随机推荐

  1. windows 与 Linux SOCKET通讯

    windows client 端口 // Def_win_client_socket_test.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" ...

  2. phantomjs问题收集

    1. phantomjs如果遇到重定向的url,两个页面都会加载,onInitialized只会执行一次,onResourceReceived会执行两次.我试过在onInitialized加一段代码, ...

  3. python 函数调用顺序

    def foo(): print ('in the foo') bar() def bar(): print ('in the bar') foo() 1.foo函数进入内存 2.bar函数进入内存 ...

  4. Maven中maven-source-plugin,maven-javadoc-plugin插件的使用

    摘要:今天领导说要把项目通过maven生产源码包和文档包并发布到自己的私服上,经过查看mavne官网发现有两个maven插件可以做到这些工作,一个是maven-source-plugin,另一个是ma ...

  5. SpringMVC 学习 九 SSM环境搭建 (二) Spring配置文件的编写

    spring配置文件中需要干的事情 (一)开启  Service与pojo包的注解扫描 注意:spring 扫描与表对应的实体类,以及service层的类,不能用来扫描Controller层的类,因为 ...

  6. git版本控制工具的使用(3)

    git remote查看远程库的信息get remote -v可以更详细,查看推送和抓取权限 git push origin master把本地的master提交到远程的库对应的主分支 gt push ...

  7. GO介绍,环境的配置和安装 简单使用

    1. 介绍与安装 Golang 是什么 Go 亦称为 Golang(按照 Rob Pike 说法,语言叫做 Go,Golang 只是官方网站的网址),是由谷歌开发的一个开源的编译型的静态语言. Gol ...

  8. 初识kbmmw 5 中httpsys的支持

    前两天kbmmw 发布了5.0 版.里面一个非常令人兴奋的特性就是原生内部支持http.sys. 有关http.sys 的介绍及优势,我就在这里不多说了,大家可以参照一下我以前的文章. 关于http. ...

  9. Java的GUI设计小技巧

    不可关闭窗口 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);

  10. 728. Self Dividing Numbers

    class Solution { public: vector<int> selfDividingNumbers(int left, int right) { vector<int& ...