摘要: 实验4 代码 点击查看代码 #include <stdio.h> int main() { FILE *fp; int line = 0; int sum = 0; int ch; fp = fopen("data4.txt", "r"); if (fp == NULL) { printf("失败\ 阅读全文
posted @ 2026-06-22 22:18 爱猫蒜 阅读(9) 评论(0) 推荐(0)
摘要: 实验4 代码 点击查看代码 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; 阅读全文
posted @ 2026-06-15 21:49 爱猫蒜 阅读(7) 评论(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, in 阅读全文
posted @ 2026-05-28 21:57 爱猫蒜 阅读(15) 评论(0) 推荐(0)
摘要: 实验1 代码 点击查看代码 #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", si 阅读全文
posted @ 2026-05-03 14:46 爱猫蒜 阅读(11) 评论(0) 推荐(0)
摘要: 实验1 代码 点击查看代码 #include <stdio.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade 阅读全文
posted @ 2026-04-21 14:44 爱猫蒜 阅读(10) 评论(0) 推荐(0)
摘要: 实验1 代码 点击查看代码 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int number; int i; srand(time(0)); // 以当前系统时间作为随机种子 fo 阅读全文
posted @ 2026-04-06 16:49 爱猫蒜 阅读(12) 评论(0) 推荐(0)
摘要: - 实验1 - 代码1 点击查看代码 #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 @ 2026-03-20 20:43 爱猫蒜 阅读(12) 评论(0) 推荐(0)