第三周实践项目二————本月有几天
2016-03-16 21:36
441 查看
/*copyright(c)2016.烟台大学计算机学院 * All rights reserved, * 文件名称:text.Cpp * 作者:吴敬超 * 完成日期:2016年3月15日 * 版本号:vc++6.0 * * 问题描述: * 输入描述: * 程序输出: */ #include<iostream> using namespace std; int main() { int day,month,year; cin>>year>>month; switch(month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12:cout<<"31"<<endl;break; case 4: case 6: case 9: case 11:cout<<"30"<<endl;break; case 2:if((year%4==0&&year%100!=0)||(year%400==0)) { cout<<"29"<<endl; } else { cout<<"28"<<endl; }break; default:cout<<"您输入的数据有误"<<endl; } return 0; }
运行结果:
相关文章推荐
- 解答Google的一道面试题
- linux ulimit 优化系统
- 【Hadoop学习】之Map-Reduce(一)
- 番外篇:flask.sqlite3之灵异bug
- Android开发之网络通讯详解
- 第二周计划
- JavaScript 一种轻量级的编程语言
- codeforces 514E E. Darth Vader and Tree(矩阵应用)
- Yahoo Hadoop Module 7: Managing a Hadoop Cluster
- 如何使用Tomcat配置本地服务器
- 在fairland的生活
- cisco 网络上设备配置NTP
- jquery ajax
- LA3635 Pie
- 【LeetCode】69. Sqrt(x) 二分查找实现开平方函数
- 23种设计模式之形象比喻
- Class.getResource()、ClassLoader.getResource()和this.class.getClassLoader()解析
- SQL不常发生的小问题
- 迟到的总结(五)--springmvc的系统学习之拦截器
- python 之分发包