摘要: 实验任务1: 代码: // 文件读写操作:格式化读、写文本文件 #include <stdio.h> #define N 80 #define M 100 typedef struct { char name[N]; // 书名 char author[N]; // 作者 } Book; void 阅读全文
posted @ 2025-06-08 23:57 一剑江湖114514 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务1: 代码: // P286例8.17 // 对教材示例代码作了微调,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息、打印所有学生信息均调用该模块实现 #include <stdio.h> #include <string.h> #define N 3 // 运行程序输入测试 阅读全文
posted @ 2025-05-30 20:51 一剑江湖114514 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务1 代码1: #include <stdio.h> #define N 5 void input(int x[], int n); void output(int x[], int n); void find_min_max(int x[], int n, int *pmin, int *p 阅读全文
posted @ 2025-05-18 17:34 一剑江湖114514 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务一 代码 #include <stdio.h> #define N 4 #define M 2 void test1() { int x[N] = {1, 9, 8, 4}; int i; // 输出数组x占用的内存字节数 printf("sizeof(x) = %d\n", sizeof( 阅读全文
posted @ 2025-04-20 11:59 一剑江湖114514 阅读(12) 评论(0) 推荐(0)
摘要: 实验任务1 代码: #include <stdio.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade = s 阅读全文
posted @ 2025-04-06 17:21 一剑江湖114514 阅读(22) 评论(0) 推荐(0)
摘要: 实验任务一 程序: #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int number; int i; srand(time(0)); // 以当前系统时间作为随机种子 for(i 阅读全文
posted @ 2025-03-22 11:36 一剑江湖114514 阅读(19) 评论(0) 推荐(0)
摘要: 实验任务一: 程序1: //打印一个字符小人 #include <stdio.h> #include <stdlib.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); system("pause"); return 阅读全文
posted @ 2025-03-08 17:52 一剑江湖114514 阅读(16) 评论(0) 推荐(0)