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

 #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. BZOJ 1391 [CEOI] Order - 网络流 最大流

    Solution 非常简单的建边!!! 但是刚开始的代码不够体现社会主义的优越性, 于是我 .... 惨痛教训啊... 终于到了今天才能够体现社会主义优越性... Code #include<c ...

  2. UX设计秘诀之注册表单设计,细节决定成败

    以下内容由摹客团队翻译整理,仅供学习交流,摹客iDoc是支持智能标注和切图的产品协作设计神器. 说实话,现实生活中,又有多少人会真正喜欢填写表格?显然,并不多.因为填写表单这样的网页或App服务,并非 ...

  3. SevenZipShaper压缩类

    //7z下载或者自己去找个地址 nurget,github之类的 链接:https://pan.baidu.com/s/1__dPu7X5b8Xr_ej9ya7Kdg 密码:q8nwusing Sev ...

  4. Two Sum III - Data structure design LT170

    Design and implement a TwoSum class. It should support the following operations:add and find. add - ...

  5. nginx fastcgi负载均衡

    当后端某机器无法连接,或者处理fastcgi请求时异常退出,nginx会将fastcgi请求发送到另外一台机器. 配置文件 http { include mime.types; default_typ ...

  6. css兼容技巧

    CSS兼容常用技巧 请尽量用xhtml格式写代码,而且DOCTYPE影响 CSS 处理,作为W3C标准,一定要加DOCTYPE声明. 1.div的垂直居中问题 vertical-align:middl ...

  7. 43.Charles抓包(iOS的http/https请求)

    Charles安装 HTTP抓包 HTTPS抓包     1. Charles安装 官网下载安装Charles: https://www.charlesproxy.com/download/ 2. H ...

  8. 【转】Linux 如何通过命令仅获取IP地址

    一同事的朋友正在参加笔试,遇到这么一个问题让他帮忙解决,结果同事又找到我帮他搞定.真是感慨:通讯发达在某些方面来说,真不知是不是好事啊!题目大致如下所示,一般我们使用ifconfig查看网卡信息,请问 ...

  9. thymeleaf使用基础教程

    thymeleaf 是新一代的模板引擎,在spring4.0中推荐使用thymeleaf来做前端模版引擎. thymeleaf介绍 简单说, Thymeleaf 是一个跟 Velocity.FreeM ...

  10. web-Amazon

    一 准备实验数据 1.1.下载数据 wget http://snap.stanford.edu/data/amazon/all.txt.gz 1.2.数据分析 1.2.1.数据格式 product/p ...