主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
damowanghwj
2024年3月30日 18:27
日期累加 题解:c++ 易于看懂 和 理解版本
P1446
回复 0
|
赞 0
|
浏览 98
/*日期累加*/ #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
|
赞 0
|
浏览 173
#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
|
赞 1
|
浏览 295
#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
|
赞 0
|
浏览 156
#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 >...
我爱陈少熙
2024年3月11日 17:32
日期累加 题解:c语言版
P1446
回复 0
|
赞 0
|
浏览 217
每次做这种题目都会忘记判断闰年的时候写else,给大家提个醒,都是小细节 #include<stdio.h> int main() { int n,y,m,d,sum; scanf("%d",&n); int year1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; while(n) { scanf("%d%...
小酒
2024年3月11日 15:25
日期累加 题解:
P1446
回复 5
|
赞 0
|
浏览 251
1446:为何正确率一直是75%,大佬帮忙看一下,谢谢! #include <bits/stdc++.h> using namespace std; int main() { int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int m,year,month,day,days; scanf("%d",&a...
阿离
2024年3月6日 11:10
日期累加 题解:跨年之后需要重新重新计算二月份天数,否则只能通过百分之
P1446
回复 0
|
赞 0
|
浏览 209
#include <bits/stdc++.h> using namespace std; struct node{ int year; int month; int day; }p; int f[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ int m; int plus; ...
orderrr
2024年2月24日 15:52
日期累加 题解:
P1446
回复 0
|
赞 1
|
浏览 250
#include <bits/stdc++.h> using namespace std; /* 思想 0、判断今年是否是闰年 1、算出 给出的日期有多少天 sumday 2、sumday + 给出的天数day sumday + day 3、如果 sumday + day > 365 或 366 那么 yea...
孙某人
2024年2月4日 10:57
日期累加 题解:易错点:如果跨年需要重新判断平年和闰年
P1446
回复 0
|
赞 0
|
浏览 311
#include <iostream> using namespace std; int ifrun(int y){ if((y%100!=0&&y%4==0)||(y%400==0)){ return 1; } else return 0; } int main(){ int n,y,m,d,add; cin >> n; for(int i=0;i<n;i++){ cin >> y >> m >> d >>add; while...
绿城
2024年1月17日 19:24
日期累加 题解:
P1446
回复 0
|
赞 1
|
浏览 373
一个比较简单的方法 当计算日期时 按照年月日的顺序进行计算 以下是代码 #include<stdio.h> #include<math.h> #include<string.h> int main() { int n; scanf("%d",&n); int year,month,day,leijia; for(int i=0;i<n;i++) ...
1
2
3
题目
日期累加
题解数量
25
发布题解
热门题解
1
日期累加 题解:
2
年份增加,需要判断平闰年
3
日期累加 题解:
4
日期累加 题解:每次都判断下是闰年还是平年,题目不难但有坑
5
同1410、1437。注意日期增加引起的月、年变化
6
1446 日期累加。详细思路分析
7
日期累加
8
日期累加;注意处理经过了很多个年
9
日期累加 题解:
10
想请问下各位,这道题,我为啥只过了66%,一直找不到原因