首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
苍灵
2025年9月1日 19:05
日期累加 题解:C++ 注意:本题需要考虑闰年
P1446
回复 0
|
赞 0
|
浏览 79
#include<bits/stdc++.h> using namespace std; struct data{ int y; int m; int d; }; // 判断年份是否是闰年 bool isRun(data a){ if((a.y%4==0&&a.y%100!=0)||(a.y%400==0)){ return true; }else{ return false; } } // 计算若干天之后的日期(需要考虑闰年) void sumHou(data a,int dsum){ ...
cczz
2025年8月5日 18:13
日期累加 题解(条理清晰,计算总天数):
P1446
回复 0
|
赞 0
|
浏览 157
#include<bits/stdc++.h> using namespace std; int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; bool isLeapYear(int y){ return (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)); } int main(){ int n; cin >> n; int y, m, d, cnt; while(n-- > 0){ ...
dhh390
2025年3月19日 16:32
日期累加 题解:c语言,注意一下坑就行
P1446
回复 0
|
赞 6
|
浏览 582
#include <stdio.h> #include <string.h> #include<stdlib.h> #include<math.h> int main() { int n; scanf("%d",&n); int i; int year,mon,day,k; int mon_day[]={0...
zxjrheaven
2025年3月12日 23:12
日期累加 题解:暴力
P1446
回复 0
|
赞 3
|
浏览 572
#include <bits/stdc++.h> using namespace std; struct date1 { int year; int moon=0; int day=0; }dat1[10005]; int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; void run(date1 a) { if((a.year%4==0...
Howie_Waves
2024年8月28日 18:28
日期累加 题解:
P1446
回复 0
|
赞 23
|
浏览 2.1k
//AC代码 //方法一---一天一天加 #include<bits/stdc++.h> using namespace std; int main() { int a; cin >> a; int f[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 ,31}; while(a--) { int y, m, d, n; cin >> y >> m >> d >> n; if(y % 400 ...
可可爱爱草莓派
2024年8月24日 16:27
日期累加 题解:注释了函数的功能
P1446
回复 0
|
赞 5
|
浏览 873
#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) { ...
damowanghwj
2024年3月30日 18:27
日期累加 题解:c++ 易于看懂 和 理解版本
P1446
回复 0
|
赞 14
|
浏览 1.5k
/*日期累加*/ #include<bits/stdc++.h> using namespace std; bool is_Leap(int year){//判断闰年 if(year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)){ return true; } return false; } int mday[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int main() { ...
渐鸿于陆
2024年3月24日 09:54
日期累加 题解:成功AC,注意下年份增加了,要重新判断平闰年
P1446
回复 0
|
赞 12
|
浏览 1.3k
#include<stdio.h> int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(void){ int m; int year,month,day,num; scanf("%d",&m); while(m--){  ...
FIVEszc
2024年3月16日 18:13
日期累加 题解:每次都判断下是闰年还是平年,题目不难但有坑
P1446
回复 0
|
赞 8
|
浏览 1.2k
#include <bits/stdc++.h> using namespace std; int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main() { int m; scanf("%d",&m); for(int i=0;i<m;i++) { int y,m,d,n; scanf("%d%d%d%d",&y,&m,&d,&n); for(int j=0;j<n;j+...
huanghu
2024年3月15日 11:51
日期累加 题解:
P1446
回复 0
|
赞 2
|
浏览 891
#include <stdio.h> #include <iostream> using namespace std; int main(){ int arr[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int n; cin >> n; while(n--){ int year, month, day, count; cin >> year >> month >> day >...
1
2
3
4
题目
日期累加
题解数量
31
发布题解
在线答疑
热门题解
1
日期累加 题解:
2
日期累加 题解:c++ 易于看懂 和 理解版本
3
日期累加 题解:成功AC,注意下年份增加了,要重新判断平闰年
4
日期累加 题解:c语言版
5
日期累加 题解:每次都判断下是闰年还是平年,题目不难但有坑
6
日期累加 题解:c语言,注意一下坑就行
7
日期累加 题解:注释了函数的功能
8
日期累加 题解:暴力
9
日期累加 题解:跨年之后需要重新重新计算二月份天数,否则只能通过百分之五十
10
1446 日期累加。详细思路分析