当前位置:网站首页>输入年份与月份,求该月共有多少天
输入年份与月份,求该月共有多少天
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;
}边栏推荐
猜你喜欢

「运维有小邓」实时监控用户登录操作

Flume configuration 2 - ganglia for monitoring

数据链路层

fastadmin后台设置单选按钮

【Try to Hack】vulnhub narak

Mysql Json 数据类型&函数
![[compilation principle] type check](/img/fc/458871e2df4e0384f65e09faa909d7.png)
[compilation principle] type check
![[notes] take notes again -- learn by doing Verilog HDL – 014](/img/92/ba794253f1588ff9ad87d2571a453e.png)
[notes] take notes again -- learn by doing Verilog HDL – 014

data link layer

Mapbox GL development tutorial (12): loading surface layer data
随机推荐
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
C#_ Convert camera images to bitmap format and draw Crosshairs
jfinal中如何使用过滤器监控Druid监听SQL执行?
Notepad++ -- macro (record operation process)
Nutch2.1 distributed fetching
攻防演练中的防守基石——全方位监控
mapbox-gl开发教程(十二):加载面图层数据
Finally, Amazon~
I found another cross domain method by chance. I don't know if anyone has ever played this way
命令执行(RCE)漏洞
How to set a pod to run on a specified node
Bigder: Automation Test Engineer
Several policies of Shenzhen Futian District to support investment attraction in 2022
Comparable comparator writing & ClassCastException class conversion exception
Spark存储体系底层架构剖析-Spark商业环境实战
Oracle保留字查询
JMeter BeanShell explanation and thread calling
Withdrawal of user curve in qualified currency means loss
Flume-ng配置
使用Gunicorn部署web.py应用