[noj 1561] Set Time
来源:互联网 发布:足球竞猜软件 编辑:程序博客网 时间:2024/06/06 18:03
简单模拟题。这代码长度应该还行,挺短了。
#include<iostream>#include<cstdio>using namespace std;int getyear(int x){if((x%4 == 0 && x%100 != 0) || x%400 == 0)return 366;return 365;}int month[2][13] = {{31,28,31,30,31,30,31,31,30,31,30,31},{31,29,31,30,31,30,31,31,30,31,30,31}};int main(){int n;while(~scanf("%d", &n)){int sy = 1970;int x = n;while(x >= 0)x -= getyear(sy++)*86400;printf("year: %d\n", sy-1970);x = n;int re = 0;sy = 1970;while(x >= 86400*getyear(sy)){x -= 86400*getyear(sy++);re += 12;}int i = 0;while(x >= 0){int t = getyear(sy)-365;x -= month[t][i]*86400;i = ++i ==12 ? 0 : i;re++;}printf("month: %d\n", re);printf("day: %d\n", n / 86400 + 1);}}
0 0
- [noj 1561] Set Time
- NBUT 1561 Set Time
- NOJ 1219 Time
- java set system time
- The tough time <set>
- NOJ 1561 算24
- Noj
- about Set Session Time Zone
- mybatis set session time zone
- Set statistics time 输出 CPU time> elapsed time
- set statistics time on的使用
- ZOJ Problem Set - 3875||Lunch Time
- loop until ntp time is set
- set statistics time on的理解
- Set-based Similarity Search for Time Series
- Transact-SQL命令----SET STATISTICS IO和SET STATISTICS TIME
- sql性能调试,set statistics io 和 set statistics time
- set statistics io / set statistics time结果解释(MSSQL)
- POJ 2653 Pick-up sticks
- 数据仓库篇章 OLTP/OLAP 区别
- c#中处理关于SQL中BLOG大数据的方法
- linux网络编程-服务器端线程池技术(C语言实现)
- window下设置apache虚拟主机
- [noj 1561] Set Time
- Java语言中的值传递与引用传递
- poj 3177 Redundant Paths
- Nginx学习之十-超时管理(定时器事件)
- Linux cron输出导致僵尸进程案例及解决
- XMPPFrameWork IOS 开发(一)xmpp简介
- 美国名校为何青睐爱吃泡面的考生
- 正则表达式语法
- XCode检测不到iphone设备 解决方案