摘要: task1 #include <stdio.h> #define N 80 #define M 100 typedef struct { char name[N]; // 书名 char author[N]; // 作者 } Book; void write(); void read(); int 阅读全文
posted @ 2025-12-29 12:40 202563430006丁梓轩 阅读(14) 评论(1) 推荐(0)
摘要: 实验6 c语言结构体和枚举应用编程 #include <stdio.h> #include <string.h> #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; // 学号 char name[20]; / 阅读全文
posted @ 2025-12-19 20:18 202563430006丁梓轩 阅读(27) 评论(1) 推荐(0)
摘要: #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 *pmax); int m 阅读全文
posted @ 2025-12-05 22:08 202563430006丁梓轩 阅读(14) 评论(1) 推荐(0)
摘要: task1. #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(x) 阅读全文
posted @ 2025-11-10 19:51 202563430006丁梓轩 阅读(19) 评论(1) 推荐(0)
摘要: #include <stdio.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade = score_to_gr 阅读全文
posted @ 2025-10-24 09:40 202563430006丁梓轩 阅读(38) 评论(1) 推荐(0)
摘要: 1 include <stdio.h> include <stdlib.h> include <time.h> define N 5 define N1 80 define N2 35 int main() { int cnt; int random_major, random_no; srand( 阅读全文
posted @ 2025-10-14 15:48 202563430006丁梓轩 阅读(9) 评论(1) 推荐(0)
摘要: 实验1 task1_1.c include <stdio.h> int main() { int n = 2; while (n--) { printf(" O \n"); printf("\n"); printf("I I\n"); } return 0; } task2_1.c include 阅读全文
posted @ 2025-10-08 21:05 202563430006丁梓轩 阅读(12) 评论(1) 推荐(0)