当前位置:网站首页>输入年份与月份,求该月共有多少天
输入年份与月份,求该月共有多少天
2022-06-29 20:23:00 【DianMu_DM】
x指年份,y指月份。代码不一定完善,还请大佬们多多指正。
//exam P92(3)
#include<iostream>
using namespace std;
int main()
{
int x,y;
cout<<"请输入年份:";
cin>>x;
cout<<"请输入月份:";
cin>>y;
switch (y)
{
case 1:case 3:case 5:case 7:case 8:case 10:case 12:cout<<"该月共有31天";break;
case 4:case 6:case 9:case 11:cout<<"该月共有30天";break;
case 2:if(x%4!=0)
cout<<"该月共有28天";
else cout<<"该月共有29天";break;
default:cout<<"请输入正确的月份";break;
}
return 0;
}边栏推荐
- Dynamics crm: among locally deployed servers, sandbox, unzip, VSS, asynchronous and monitor services
- The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
- lock4j--分布式锁中间件--自定义获取锁失败的逻辑
- 使用Gunicorn部署web.py应用
- 「运维有小邓」Active Directory 密码过期通知功能
- Introduction to the latest version 24.1.0.360 update of CorelDRAW
- Jupyter service installation and startup
- 攻防演练中的防守基石——全方位监控
- Freemaker template framework generates images
- Codeforces Global Round 21 C D E
猜你喜欢

Hangfire details

Flume配置4——自定义Source+Sink

Flume配置2——监控之Ganglia

关于印发宝安区重点产业项目和总部项目遴选及用地保障实施细则(2022修订版)的通知

如何审核 Active Directory 用户账户更改?

Withdrawal of user curve in qualified currency means loss

Uncover the secret! Pay attention to those machines under the membership system!

「运维有小邓」日志分析工具使用越来越频繁的原因
![[notes] take notes again -- learn by doing Verilog HDL – 008](/img/7f/0ca73446247455ac4d8f9667083a87.png)
[notes] take notes again -- learn by doing Verilog HDL – 008

.NetCore统一认证授权学习——Run(1)
随机推荐
Wangedit rich text editor usage (detailed)
偶然发现了另一种跨域方式,不知道有没有人这么玩过
Measures to support the development of advanced manufacturing industry in Futian District of Shenzhen in 2022
2021 CCPC Harbin J. local minimum (thinking question)
mapbox-gl开发教程(十二):加载面图层数据
. NETCORE unified authentication authorization learning - run (1)
Flume configuration 3 - interceptor filtering
社区访谈丨一个IT新人眼中的JumpServer开源堡垒机
Community interview -- jumpserver open source fortress in the eyes of an it newcomer
Ovirt database modify delete node
【译】十二因子应用(四)
Summary of swift optional values
liunx指令
【摸鱼神器】UI库秒变低代码工具——表单篇(一)设计
Uncover the secret! Pay attention to those machines under the membership system!
网站压力测试工具——Webbench
annotation
「运维有小邓」AD域委派
Jmeter之BeanShell详解和夸线程调用
2022年深圳市福田区支持招商引资若干政策