摘要: 实验1、2、3已实践 实验4:代码如下 #include <stdio.h> int main() { char ch; int k=0; FILE *fp; fp = fopen("data4.txt", "r"); if(fp == NULL) { printf("fail to open fi 阅读全文
posted @ 2023-06-11 15:29 zhangchuyu 阅读(22) 评论(0) 推荐(0)
摘要: 实验1、2、3已完成验证,充分学习理解了结构体相关知识点。 实验4: #include <stdio.h> #include <stdlib.h> #define N 100 typedef struct { char num[10]; // 学号 int s1; // 期末成绩 int s2; / 阅读全文
posted @ 2023-05-27 22:31 zhangchuyu 阅读(23) 评论(0) 推荐(0)
摘要: //实验一:#include <stdio.h> #include <string.h> #define _CRT_SECURE_NO_WARNINGS #define N 4 int main() { int x[N] = { 1, 9, 8, 4 }; int i; int* p; // 方式1 阅读全文
posted @ 2023-05-07 22:01 zhangchuyu 阅读(21) 评论(0) 推荐(0)
摘要: 实验1: 由运行结果可知,int型数组在内存中不是连续存放的,每个元素占用4个字节。char型数组是连续存放的,每个元素占用1个字节单元。 a[0]与a数组的值是一样的。b[0]与b数组的值是一样的。 实验1.2:由上图可知,int型二维数组a,在内存中不是"按行连续存放"的,每个元素占用4个内存字 阅读全文
posted @ 2023-04-15 22:13 zhangchuyu 阅读(33) 评论(0) 推荐(0)
摘要: 实验1.#include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void print_text(int line, int col, char text[]); // 函数声 阅读全文
posted @ 2023-04-01 21:29 zhangchuyu 阅读(31) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define R1 586 #define R2 701 int main() { int number; int i; srand(time(0)); for 阅读全文
posted @ 2023-03-16 23:14 zhangchuyu 阅读(58) 评论(1) 推荐(0)
摘要: task1 打印字符小人 #include <stdio.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); printf(" o \n"); printf("<H>\n"); printf("I I\n"); ret 阅读全文
posted @ 2023-03-03 22:00 zhangchuyu 阅读(48) 评论(0) 推荐(0)