HDOJ2005第几天
第几天?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 68932 Accepted Submission(s): 26152
2006/3/12
71
#include<stdio.h> int month[] = {,,,,,,,,,,,};
int is_leap(int m)
{
return (m%== || (m%==&&m%!=));
}
int count(int y, int m)
{
int i, day = ;
for(i = ; i < m; i++)
day +=month[i];
if(m > )
day += is_leap(y);
return day;
}
int main()
{
int y, m, d, day;
while(scanf("%d/%d/%d", &y, &m, &d)== )
{
day = d+count(y,m-);
printf("%d\n", day);
}
return ;
}
HDOJ2005第几天的更多相关文章
随机推荐
- MS-SQL Server字符串处理函数大全
MS-SQL Server字符串处理函数大全 select语句中只能使用sql函数对字段进行操作(链接sql server), select 字段1 from 表1 where 字段1.Index ...
- python的sys.path
python检测不到模块: No module named 是因为模块没有在sys.path中,查看sys.path的方法 import sys sys.path 发现确实没有加载到模块. windo ...
- 开源的读取Excel文件组件-ExcelDataReader
ExcelDataReader可以读取 Microsoft Excel 文件 ('97-2007),支持Windows .Net Framework 2 +. Windows Mobile with ...
- PC/UVa 题号: 110101/100 The 3n+1 problem (3n+1 问题)
The 3n + 1 problem Background Problems in Computer Science are often classified as belonging to a ...
- Eclipse下如何导入jar包【转载】
我们在用Eclipse开发程序的时候,经常想要用到第三方的jar包.这时候我们就需要在相应的工程下面导入这个jar包.以下配图说明导入jar包的步骤. 1.右击工程的根目录,点击Properties进 ...
- zoj 2112 Dynamic Rankings 动态第k大 线段树套Treap
Dynamic Rankings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/show ...
- c#加密 可逆与不可逆MD5 加密
1.方法一 (不可逆加密) srxljl public string EncryptPassword(string PasswordString,string PasswordFormat ) ...
- uva216 c++回溯法
因为题目要求最多8台电脑,所以可以枚举全排列,然后依次计算距离进行比较,枚举量8!=40320并不大,但这种方法不如回溯法好,当数据再大一些枚举就显得笨拙了,所以这个题我用回溯法做的,回溯有一个好处是 ...
- MySQL join buffer使用
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://huanghualiang.blog.51cto.com/6782683/12 ...
- ptrace x64 转
#include <sys/ptrace.h> #include <sys/types.h> #include <sys/wait.h> #include < ...