摘要: 实验4 #include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> signed main() { FILE *fp; fp=fopen("data4.txt","r"); if(fp==NULL){ pr 阅读全文
posted @ 2025-12-25 19:29 Carrotz 阅读(14) 评论(1) 推荐(0)
摘要: 实验任务4 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; // 售价 i 阅读全文
posted @ 2025-12-19 19:37 Carrotz 阅读(11) 评论(1) 推荐(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 *pmax); 阅读全文
posted @ 2025-12-07 10:57 Carrotz 阅读(19) 评论(1) 推荐(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", sizeof(x)); 阅读全文
posted @ 2025-11-10 17:04 Carrotz 阅读(18) 评论(1) 推荐(0)
摘要: 实验1 #include <stdio.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade = score_t 阅读全文
posted @ 2025-10-24 13:22 Carrotz 阅读(15) 评论(1) 推荐(0)
摘要: 实验1 问题1:srand(time(NULL))设置时间为随机种,保证每次随机数都不一样 问题2:在两个班中随机抽五个学号 实验2 问题1:每次循环总价不清空,导致后面询问时数据出错 问题2:结束这一轮循环,跳过后面的语句; 实验3 #include<stdio.h> int main(){ ch 阅读全文
posted @ 2025-10-14 13:59 Carrotz 阅读(13) 评论(1) 推荐(0)
摘要: 实验任务1 #include <stdio.h> #include <math.h> signed main() { //任务1 // printf(" O \n"); // printf("<H>\n"); // printf("I I\n"); //任务1_1 // printf(" O \n" 阅读全文
posted @ 2025-09-26 20:13 Carrotz 阅读(10) 评论(1) 推荐(0)