文章
38
粉丝
11
获赞
2
访问
31.0k
#include<bits/stdc++.h>
using namespace std;
int m[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int judge(int year){//用于判断闰年,修改2月份天数,并返回这一年有多少天
int year_day;
if(year % 400 == 0|| year %4 == 0 && year % 100 != 0) {
m[2] = 29;
year_day = 366;
}
else {
m[2] = 28;
year_day = 365;
}
return year_day;
}
int ymd(){//用于写出单次时间
int year,month,day,ad;
cin >> year >> month >> day >> ad;
ad += day;
int year_day = judge(year);
for(int i = 1;i < month;i++){
ad += m[i];
}
while(ad > year_day){
ad -= year_day;
...
登录后发布评论
暂无评论,来抢沙发