首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
lilililili
2024年3月10日 23:56
打印日期 题解:c语言-简短
P1410
回复 0
|
赞 0
|
浏览 974
#include<stdio.h> int main(){ int i,year,day,num=0,a[12]={31,28,31,30,31,30,31,31,30,31,30,31}; while(scanf("%d%d",&year,&day)!=EOF){ if(year%400==0||(year%4==0&&year%100!=0)) &n...
huanghu
2024年3月10日 00:12
打印日期 题解:C++
P1410
回复 0
|
赞 0
|
浏览 880
#include<stdio.h> #include<iostream> using namespace std; int main(){ int year,n; while(cin>>year>>n){ int arr[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; bool isLeap = year%400==0 || year%100!=0 && year%4==0; ...
FIVEszc
2024年3月8日 22:10
打印日期 题解:C 显示60%通过,求大佬帮我看看哪里的问题
P1410
回复 1
|
赞 0
|
浏览 1.5k
#include <stdio.h> int main() { int y,n; while(scanf("%d %d",&y,&n) != EOF){ int d,month=1,i=1; int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; if(y%400==0||(y%4==0&&y%100!=0)) mon[2]=29; for(;i<13;i++) {n=n-mon[i]; if(n==0)n++; if(n<0...
williams
2024年3月5日 18:00
打印日期 题解:
P1410
回复 0
|
赞 0
|
浏览 2.0k
#include <stdio.h> #include <stdbool.h> #include <math.h> #include <string.h> int main(void) { int y,n; int run[12]={31,29,31,30,31,30,31,31,30,31,30,31}; int normal[12]={31,28,31,30,31,30,31,31,30,31,30,31}; while(scanf("%d %d",&y,&n)!=...
小王桐学
2024年3月1日 18:26
打印日期 题解:C
P1410
回复 0
|
赞 0
|
浏览 1.1k
#include <stdio.h> void PrintDate(int d[],int y,int n) { if((y % 400 == 0) || (y % 100 != 0 && y % 4 == 0)) //判断闰年 d[1]++; int i; for(i = 0; i < 12; i++) { if(n <= 0) break; else n -= d[i]; } n = n+d[i-1]; if(i >= 9) if(n >= 10) printf...
DestinyCares+++
2024年1月28日 10:04
打印日期 题解:1410
P1410
回复 0
|
赞 0
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; bool isrun(int y){ if(((y%4==0)&&(y%100!=0))||(y%400==0)) return true; else return false; } int date[13][2]={{0,0},{1,31},{2,28},{3,31},{4,30},{5,31},{6,30},{7,31},{8,31},{9,30},{10,31},{11,...
孙某人
2024年1月19日 10:50
打印日期 题解:求大佬帮我分析一下这种情况的原因
P1410
回复 2
|
赞 1
|
浏览 1.1k
这是完整代码,通过率100%没问题 #include<iostream> #include <string.h> using namespace std; int main(){ int y=0,d=0,m=0,c=0,d1=0; //这里========================================================================================= char cc[100][11]; for(int i=0;i<100;i++){ for(i...
Cookie‘s AE86
2024年1月18日 16:00
打印日期 题解:大佬帮我康康哪里错了
P1410
回复 1
|
赞 1
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std ; //判断是否是闰年 bool judge(int year){ if(year % 4 == 0 ){ if(year % 400) return true ; else if(year % 100) return false ; else return true...
983103231
2020年4月23日 15:33
代码哪里有问题啊,总共也就做了十几道题至少有三道题了,试不出任何问题的
P1410
回复 3
|
赞 0
|
浏览 10.6k
#include <iostream> #include <cmath> #include <cstring> using namespace std; int main() { int m, n; int month, day; char mout[20], dout[20]; cin >> m >> n; int f[13] = {0, 31, 29, 31,...
dongqing
2023年7月26日 17:28
打印日期
P1410
回复 0
|
赞 1
|
浏览 1.3k
注意如何确定月份,用连续几个月份相加观察看看是否大于当前数字如果大于那么就是当前月份,日期用到目前位置的当前月份的总天数和减去当前月份的天数因为没有用完,用总天数减去刚计算的和 为实际day 注意输出的格式,注意判断闰年。 #include<bits/stdc++.h> using namespace std; int main() { int f[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int year,data,m,day; while(cin>>...
1
2
3
4
题目
打印日期
题解数量
40
发布题解
在线答疑
热门题解
1
打印日期 题解:只有60% ,求大佬提点
2
打印日期 题解:
3
打印日期 题解:
4
打印日期 题解:
5
打印日期 题解:C语言题解 多组输入
6
打印日期 题解:求大佬解释下为什么只有60%通过率
7
打印日期 题解:暴力题解
8
打印日期(用前缀和写了一下 附注释) 题解:
9
打印日期 题解:C++实现
10
打印日期 题解:暴力