摘要: 实验任务四 程序代码 #include <stdio.h> #include <stdlib.h> #include <ctype.h> int main(){ FILE *file = fopen("data4.txt","r"); if (file == NULL) { perror("无法打开 阅读全文
posted @ 2025-06-08 00:02 古明地理 阅读(17) 评论(0) 推荐(0)
摘要: 实验任务四 程序代码 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; // 阅读全文
posted @ 2025-06-02 20:29 古明地理 阅读(15) 评论(0) 推荐(0)
摘要: 实验任务一 task1_1.c 程序代码 #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 *pm 阅读全文
posted @ 2025-05-19 10:49 古明地理 阅读(23) 评论(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", sizeo 阅读全文
posted @ 2025-04-21 10:41 古明地理 阅读(20) 评论(0) 推荐(0)
摘要: 实验任务1 程序代码 #include <stdio.h> char score_to_grade(int score); int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade = score_to 阅读全文
posted @ 2025-04-09 18:06 古明地理 阅读(23) 评论(0) 推荐(0)
摘要: 实验任务1 程序代码 #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 23:34 古明地理 阅读(19) 评论(0) 推荐(0)
摘要: 实验任务一 task1_1.c #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"); 阅读全文
posted @ 2025-03-08 22:20 古明地理 阅读(31) 评论(0) 推荐(0)