多少天
来源:互联网 发布:扫描转换文字软件 编辑:程序博客网 时间:2024/06/02 21:31
#include<iostream>
using namespace std;
int main()
{
int year,month,day;
int t=0;
cin>>year>>month;
if(year%400==0||(year%100!=0&&year%4==0))
t=1;
if(t==1)
{
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
cout<<"31"<<endl;
if(month==4||month==6||month==9||month==11)
cout<<"30"<<endl;
if (month==2)
cout<<"29"<<endl;
}
if(t==0)
{
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
cout<<"31"<<endl;
if(month==4||month==6||month==9||month==11)
cout<<"30"<<endl;
if (month==2)
cout<<"28"<<endl;
}
return 0;
}
using namespace std;
int main()
{
int year,month,day;
int t=0;
cin>>year>>month;
if(year%400==0||(year%100!=0&&year%4==0))
t=1;
if(t==1)
{
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
cout<<"31"<<endl;
if(month==4||month==6||month==9||month==11)
cout<<"30"<<endl;
if (month==2)
cout<<"29"<<endl;
}
if(t==0)
{
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
cout<<"31"<<endl;
if(month==4||month==6||month==9||month==11)
cout<<"30"<<endl;
if (month==2)
cout<<"28"<<endl;
}
return 0;
}
0 0
- 多少天
- 判断两个时间相差多少天多少分多少秒
- 相隔日期有多少天多少时
- 某年某月多少天函数
- 本月有多少天?
- 本月有多少天
- 本月一共多少天
- 活了多少天
- 本月有多少天
- 每年每月多少天
- 整形数字转化为多少天,多少小时,多少分钟,多少秒
- ios 两个时间之间的比较,相差多少天多少小时多少分多少秒
- java计算两个日期间相差多少天多少小时多少分多少秒
- 多少
- 多少
- 多少
- JS实现多少小时前,多少天前...
- 计算两个日期相隔多少年,多少月,多少天
- 前端图形技术 之 CSS 实现标签容器
- 树莓派配置完全手册(三)开发环境的安装及配置
- Maven 基础命令和pom.xml标签
- 大话设计模式-代理模式
- 磁盘调度算法剖析(FIFO、SSTF、SCAN、CSCAN、FSCAN)
- 多少天
- 公约数
- jvm常量池
- lesson 3 内存
- 角色一
- Lua模仿类似观察者模式的监听变量改变自动刷新
- 卷积神经网络_图像卷积解释
- hive与关系型数据库对比
- 角色二