结构体之时间设计 摘要:解题思路:先根据年份判断平闰年调用函数实现天数判断最后返回天数即可注意事项:在定义类的时候不能定义为已有的函数名称,否则报错参考代码:#include<iostream>using namespace…… 题解列表 2024年01月27日 0 点赞 0 评论 511 浏览 评分:0.0
for循环+结构体 解题思路:第一步:写结构体。第二步:判断是否是闰年一三五七八十腊是31天二月若为闰年则是29天,否则为28天其余为30天。注意事项:循环体不应该包含本月,否则会将本月全部日子加上去,应该循环结束后加上本月日期。参考代码:#include#include/*runt 题解列表 2024年01月31日 0 点赞 0 评论 554 浏览 评分:0.0
结构体之时间设计 解题思路:先判断是闰年还是平年,闰年二月29天,平年二月28天,然后再按照月份将天数相加。注意事项:for循环的时候并不是直接月数,而是月数-1,加上输入的几号参考代码:importjava.util.Scanner;/*定义一个结构体变量(包括年、月、日)。 题解列表 2024年03月17日 0 点赞 0 评论 541 浏览 评分:0.0
结构体!!! 摘要:不知道还有没有哪里可以改进的#include<stdio.h> int main() { struct{ int year; int month; int …… 题解列表 2024年03月26日 0 点赞 0 评论 510 浏览 评分:0.0
结构体之时间设计 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ struct Date { int year; int month; int day; }s; scanf…… 题解列表 2024年04月05日 0 点赞 0 评论 482 浏览 评分:0.0
1049时间设计(结构体实现) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>typedef struct shijian{ int nian; int yue; int ru;}shijian;int main(…… 题解列表 2024年05月23日 0 点赞 0 评论 444 浏览 评分:0.0
编写题解 1049: [编程入门]结构体之时间设计 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<stdlib.h> struct c{ int y; int m; int d; …… 题解列表 2024年06月11日 0 点赞 0 评论 465 浏览 评分:0.0
无聊的星期六 摘要:#include <stdio.h> typedef struct days { int year; int month; int day; }days; …… 题解列表 2024年08月17日 0 点赞 0 评论 695 浏览 评分:0.0
1049:结构体之时间设计--思路 #C++ 摘要:##### 闰年条件 1. 4 的倍数 2. 400 的倍数 ```cpp year % 4 == 0 && year % 100 != 0 //% 取模 ``` ```cpp …… 题解列表 2024年09月17日 1 点赞 0 评论 621 浏览 评分:0.0
编写题解 1049: [编程入门]结构体之时间设计 摘要:解题思路:注意事项:参考代码:#include <stdio.h>// 定义日期结构体struct Date { int year; int month; int day;};// …… 题解列表 2024年09月20日 0 点赞 0 评论 520 浏览 评分:0.0