首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
1576684866
2024年3月23日 16:00
日期差值 题解:
P1290
回复 0
|
赞 1
|
浏览 734
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; #include <string.h> #include <algorithm> #include <iostream> #include <map> #include <stdlib.h> bool isLeapYear(int year) { if ((year % 4 == 0 && year % 1...
渐鸿于陆
2024年3月23日 11:41
日期差值 题解:有人能看出有啥问题吗?
P1290
回复 2
|
赞 2
|
浏览 959
#include<stdio.h> #include<stdlib.h> int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int day(int n){ int year = n/10000; int month = n/10000/100; int da = n/10000%100; days[2] = (year%...
Śś
2024年3月23日 10:09
日期差值 题解:相对第一个日期当年第一天
P1290
回复 0
|
赞 1
|
浏览 844
/* 例如: 20190916 20240323 先计算第一个日期相对20190101的天数 再计算第二个日期相对20190101的天数 作差 +1 输出 //加减顺序可以调换 */ #include<iostream> using namespace std; int mdays1[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31}; int mdays2[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; in...
orderrr
2024年3月21日 15:35
日期差值 题解:c语言解决
P1290
回复 0
|
赞 1
|
浏览 899
#include <stdio.h> #include <string.h> int month[2][13] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, }; int Isleap(int y) { if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) { ...
红毛舒肤佳
2024年3月20日 18:12
日期差值 题解:C++,注释清晰,步骤较多
P1290
回复 0
|
赞 2
|
浏览 867
#include <bits/stdc++.h> using namespace std; struct date{ int year,month,day; }; int mon[13]={0, 31,28,31,30,31,30,31,31,30,31,30,31 }; int main() { date d1,d2; while(scanf("%4d%2d%2d %4d%2d%2d",&d1.year,&d1.month,&d1.day,&d2.year,&d2.mon...
zx142407789
2024年3月20日 14:56
日期差值 题解:自用笔记(C语言)
P1290
回复 0
|
赞 0
|
浏览 842
#include<stdio.h> int days[12] = { 31,0,31,30,31,30,31,31,30,31,30,31 }; int isleapyear(int year) { if (year % 400 == 0) return 1; else if (year % 4 == 0 && year % 100) return 1; else return 0; } int countdate(int x, int start) { int year, month, day, k, sum = 0; /...
Cookie‘s AE86
2024年3月12日 21:51
日期差值 题解:c++实现
P1290
回复 0
|
赞 0
|
浏览 984
#include<bits/stdc++.h> using namespace std; //判断是否是闰年 bool judge(int year){ if(year % 4 == 0 ){ if(year % 100 == 0){ if(year % 400 == 0) return true; else return false; } }else return false ; } int main(){ string s1 ,s2; ...
easymoney
2024年3月12日 11:29
日期差值 题解:
P1290
回复 0
|
赞 1
|
浏览 944
#include <stdio.h> struct date { int year; int month; int day; }p, q; int main() { int year, month, day; int f[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 }; int pre ...
小酒
2024年3月11日 15:30
日期差值 题解:
P1290
回复 0
|
赞 0
|
浏览 674
1290解题思路 struct date { int year; int month; int day; }p,q; #include <bits/stdc++.h> using namespace std; int main() { int a[13]={0,31,28,31,30,31,30,31,31...
huanghu
2024年3月8日 18:04
日期差值 题解:c++
P1290
回复 0
|
赞 0
|
浏览 885
#include<stdio.h> #include<iostream> #include<string> using namespace std; //有两个日期,求两个日期之间的天数,如果两个日期是连续的我们规定他们之间的天数为两天 int main(){ int arr[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int d1,d2; while(cin>>d1>>d2){ ...
1
2
3
4
题目
日期差值
题解数量
39
发布题解
在线答疑
热门题解
1
日期差值 题解:成功AC
2
日期差值 题解:
3
日期差值 题解:
4
从小甲鱼那里学了一个很妙的解法
5
日期差值 题解:容易理解比较笨的方法
6
日期差值(格式化输入) 题解:
7
日期差值 题解:
8
日期差值 题解:折磨人的臭臭
9
日期差值 题解:
10
自己平时怎么算,代码就怎写