首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
Adelaide111
2026年3月16日 21:07
日期差值 题解:
P1290
回复 0
|
赞 11
|
浏览 142
#include <bits/stdc++.h> using namespace std; int f[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; bool isLeapYear(int y){ if(y%400==0 ||(y%4==0&&y%100!=0)) return true; return false; } int main() { int y1,m1,d1,y2,m2,d2; while(scanf("%4d%2d%...
彻底死去
2026年3月16日 20:43
日期差值 题解:
P1290
回复 0
|
赞 2
|
浏览 44
#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<string> #include<cstring> using namespace std; int main() { int n1 = 365, n2 = 366; int days1[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 }; int days2[...
太一
2026年3月16日 17:28
日期差值 题解:
P1290
回复 0
|
赞 1
|
浏览 61
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { int a, b, month[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 }, y1, m1, d1, y2, m2, d2, sum = 0, num1 = 0, num2 = 0;; cin ...
xsw
2026年3月16日 16:38
日期差值 题解:
P1290
回复 0
|
赞 1
|
浏览 29
#include<bits/stdc++.h> using namespace std; bool is_year(int y) { return y % 400 == 0 || (y % 4 == 0 && y % 100 != 0); } int main() { string s1, s2; while (cin >> s1 >> s2) { int month[15] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 3...
王艺道
2026年3月14日 14:33
日期差值 题解:
P1290
回复 0
|
赞 3
|
浏览 62
#include<bits/stdc++.h> using namespace std; string date1, date2; int mtod[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int main(){ &n...
岸上的乌龟
2026年3月14日 09:07
日期差值 题解:简单模拟,写了半个小时......
P1290
回复 0
|
赞 0
|
浏览 71
#include<bits/stdc++.h> using namespace std; int buf[13]= {0,31,28,31,30,31,30,31,31,30,31,30,31}; int main() { int y1,m1,d1; int y2,m2,d2; while(~scanf("%4d%2d%2d",&y1,&m1,&d1)) { &n...
HKX9XAS
2026年3月13日 18:26
日期差值 题解:按年月日来分别计算差值
P1290
回复 0
|
赞 3
|
浏览 96
#include<stdio.h> #include<iostream> using namespace std; int main(){ int y1,y2,m1,m2,d1,d2; int date1,date2; int md[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; while( cin >>date1 >>...
liux662
2026年3月13日 14:47
日期差值 一天一天往后累加 题解:
P1290
回复 0
|
赞 0
|
浏览 79
#include<bits/stdc++.h> using namespace std; int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; bool is_run(int year) { if(year % 100 == 0 && year % 400 == 0) return true; if(year % 100 == 0) return false; if(year % 4 == 0) return true; return false;...
xiaoboQAQ
2026年3月12日 16:52
日期差值 新手题解:
P1290
回复 0
|
赞 8
|
浏览 105
#include<bits/stdc++.h> using namespace std; int Isleap(int year){ if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { return 1; // 是闰年 } return 0; // 不是闰年 } int Totalday(int year,int month,int day){//新手笨方法,算从元年到输入日期的总天数再相减 int total=0; ...
无名吟
2026年3月10日 19:37
日期差值 C语言题解:逐月累加
P1290
回复 0
|
赞 1
|
浏览 112
累加月份 #include<stdio.h> typedef struct ymd{ int year, month, day; }ymd; void ji(ymd *n, char ymd1[]){ n->year=(ymd1[0]-'0')*1000+(ymd1[1]-'0')*100+(ymd1[2]-'0')*10+(ymd1[3]-'0'); n->month=(ymd1[4]-'0')*10+(ymd1[5]-'0'); n->day=(ymd1[6]-'0')*10+(ymd1[7]-'0'); } ...
1
2
3
...
6
题目
日期差值
题解数量
59
发布题解
在线答疑
热门题解
1
日期差值 题解:成功AC
2
日期差值 题解:
3
日期差值 题解:用string读取日期,再转成整形
4
从小甲鱼那里学了一个很妙的解法
5
日期差值 题解:
6
日期差值 题解:容易理解比较笨的方法
7
日期差值 题解:折磨人的臭臭
8
日期差值 题解:用基准值绕开两者直接运算的复杂
9
日期差值 题解:
10
日期差值 题解:C++