![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言练习
柒度°
这个作者很懒,什么都没留下…
展开
-
【结构体学习】三天打鱼两天晒网
三天打鱼两天晒网。(30分)题目内容:中国有句俗语:“三天打鱼两天晒网”,某人从1990年1月1日起开始“三天打鱼两天晒网”。问这个人在以后的某一天是在“打鱼”还是在“晒网”?输入样例:1990-1-3输出样例:他在打鱼输入样例:2018-11-13输出样例:他在晒网#include<stdio.h>int main(){ typedef struct time { int year; int month; int day; }; time a原创 2021-12-06 17:18:56 · 1913 阅读 · 0 评论 -
【学习笔记】二维动态数组的创建
问题总结1.if()里条件为==而不是=,‘=’会使指针变为空指针从而引发异常。2.注意一维动态数组sizeof(int*)而不是int。3.记得及时释放动态内存。#include<stdio.h>#include<stdlib.h>int main(){ int n1, n2; int** arr = NULL; printf("请输入一维数组长度:"); scanf("%d",&n1); printf("请输入二维数组长度:"); scanf("原创 2021-12-02 11:31:20 · 382 阅读 · 0 评论