days
来源:互联网 发布:seo相关知识 编辑:程序博客网 时间:2024/04/30 05:30
/*储存12个月的天数*/const int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};/*判断是否为闰年*/int isLeapYear(int year){ if(((year%4==0)&&(year%100!=0)) ||(year%400==0)) { return 1; } return 0;}int CalcHowManyDays(unsigned int Year, unsigned int Month, unsigned int Day, unsigned int * pSumOfDays){ if(Month<=0||Month>12 || Day<=0||Day >31 || NULL == pSumOfDays) return -1; long sum=0; int i; //累计当年以往各月的天数 for(i=0;i<Month-1;i++) { sum+=days[i]; } if(Month>2) { if(isLeapYear(Year)) {//闰年多一天 sum+=1; } } //累计当年当月的天数 sum+=Day; *pSumOfDays = sum; return 0;}
0 0
- days
- These days
- These days.
- Seven Days
- 3 days
- New days
- 55days
- Tough Days
- These Days
- These days
- 2001.11-day of days
- Numerous Marriages These Days
- QQ 1234days
- write for these days
- Summary for these days
- Seven Lonely Days
- Seven Lonely Days
- BEA dev2dev Days 2003
- hdu1788 Chinese remainder theorem again 最小公倍数
- 将Lomboz Eclipse 连接上 Oracle 11g
- 字典树(转)
- 线程同步与异步的区别
- Java:多重循环for、while、do-while(简单判断是否是四位整数、1-100累加,水仙花、最大公约数。最小公倍数、完数、输入任意数计算每位数之和、弹力球问题)
- days
- CF 514C hash,字典树
- Buy Tickets
- 炉石传说上传说需要的局数~Python日常~
- c++primer之范围for循环
- maven配置远程repository
- SQL 更新时间字段的年份
- Spring用法快速入门
- iOS拖动手势的使用