第11周项目5-当年第几天
来源:互联网 发布:淘宝开店支付宝认证 编辑:程序博客网 时间:2024/05/16 01:01
/* *Copyright (c) 2014 ,烟台大学计算机学院 *All right reserved. *文件名称:当年第几天.cpp *作 者:王伟诚 *完成日期:2014年11月11日 *版 本 号:1.0 * *问题描述:当年第几天*问题输出:整数*/#include<iostream>using namespace std;int days(int y, int m, int d);int main(){ int year, month, day; cout<<"输入年 月 日"<<endl; cin>>year>>month>>day; cout<<"这是该年的第"<<days(year, month, day)<<"天"<<endl; return 0;}int a=0,b=31,c=30,i;int days(int y, int m, int d){ if ((y%4==0&&y%100!=0)||y%400==0) a=29; else a=28; if (m==1) i=d; else if (m==2) i=b+d; else if (m==3) i=b+a+d; else if (m==4) i=b+a+b+d; else if (m==5) i=b+a+b+c+d; else if (m==6) i=b+a+b+c+b+d; else if (m==7) i=b+a+b+c+b+c+d; else if (m==8) i=b+a+b+c+b+c+b+d; else if (m==9) i=b+a+b+c+b+c+b+b+d; else if (m==10) i=b+a+b+c+b+c+b+b+c+d; else if (m==11) i=b+a+b+c+b+c+b+b+c+b+d; else if (m==12) i=b+a+b+c+b+c+b+b+c+b+c+d; return i;}
0 0
- 第11周项目5-当年第几天
- 第11周项目5-当年第几天
- 第11周项目5 当年第几天
- 第11周项目5-当年第几天
- 第11周项目5当年第几天
- 第11周 项目5-当年第几天
- 第11周项目5-当年第几天
- 第11周项目5 当年第几天
- 第11周项目5-当年第几天
- 第11周项目5-当年第几天
- 第11周项目5-当年第几天?
- 第11周项目5-当年第几天
- 第11周项目5 当年第几天
- 第11周项目5:当年第几天
- 第11周项目5 当年第几天
- 第11周项目5-当年第几天
- 第11周 项目5 当年第几天
- 第11周项目5---当年第几天
- Android 的MVC
- JAVA 布局
- java 调用存储过程-oracle
- 2014年读书目录
- 2015远景能源校园招聘 笔试题(同济大学站)
- 第11周项目5-当年第几天
- 第十一周项目七:太乐了
- Android不被kill的Service与卸载之后跳转出反馈页面
- hdu 2255 奔小康赚大钱 KM算法 模板题
- fat tree
- windows 2003下调整分区大小
- alloc、retain、copy、new、autorelease的区别
- 十一周项目六(1) 反序数
- Maven之——Nexus权限管理与调度任务