摘要: 实验任务4 1 #include <stdio.h> 2 #include <ctype.h> 3 4 int main() { 5 FILE *fp; 6 char ch; 7 int line = 0; 8 int word = 0; 9 10 fp = fopen("data4.txt", " 阅读全文
posted @ 2025-12-30 21:20 aiuydihua 阅读(6) 评论(1) 推荐(0)
摘要: 实验任务4 1 #include <stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; // isbn号 6 char name[80]; // 书名 7 char author[80]; // 作者 8 double sale 阅读全文
posted @ 2025-12-23 17:34 aiuydihua 阅读(11) 评论(1) 推荐(0)
摘要: 实验任务1 1.1 1 #include <stdio.h> 2 #define N 5 3 4 void input(int x[], int n); 5 void output(int x[], int n); 6 void find_min_max(int x[], int n, int *p 阅读全文
posted @ 2025-12-08 16:01 aiuydihua 阅读(8) 评论(1) 推荐(0)
摘要: 实验任务1 1、是的。相同。 2、是的。相同。相差一行元素所占的总字节数。二位数组中一行元素的占用内存大小。 实验任务2 1、形参:int x[ ],int n。实参:x,n。 2、input的功能是:给数组x[ ]依次赋值。 compute的功能是:去除数组x中的最大值和最小之后求剩余数字的平均值 阅读全文
posted @ 2025-11-16 15:02 aiuydihua 阅读(6) 评论(1) 推荐(0)
摘要: 实验任务1 问题1:将输入的分数整除10,再通过switch函数输出相应的等级,并返回到ans中。形参类型是整型,返回值是字符串。 问题2:由于缺少break,当其中一行满足时,后面的代实验任务2 实验任务2 问题1:将输入的整数n的每一位上的数字相加,并返回到ans中。 问题2:可以。第一种是将整 阅读全文
posted @ 2025-10-28 17:45 aiuydihua 阅读(14) 评论(1) 推荐(0)
摘要: 实验任务1 问题1:确保每次生产的序列不同;去掉后,生成的数列固定不变。 问题2:生成随机数列。 实验任务2 问题1:去掉后,后一次循环的总金额为前面所有循环的总和。 问题2:结束本次循环,并进入下一个循环。 实验任务3 1 #include <stdio.h> 2 int main() { 3 c 阅读全文
posted @ 2025-10-14 15:51 aiuydihua 阅读(8) 评论(0) 推荐(0)
摘要: 实验任务1 task1_1.c 1 #include <stdio.h> 2 int main(){ 3 printf(" O \n"); 4 printf("<H>\n"); 5 printf("I I\n"); 6 7 return 0; 8 } task1_2.c 1 #include <st 阅读全文
posted @ 2025-09-28 16:03 aiuydihua 阅读(18) 评论(1) 推荐(0)
摘要: 实验任务1 1 #include <stdio.h> 2 int main(){ 3 printf(" O \n"); 4 printf("<H>\n"); 5 printf("I I\n"); 6 7 return 0; 8 } 实验任务2 1 #include <stdio.h> 2 3 int 阅读全文
posted @ 2025-09-26 09:20 aiuydihua 阅读(11) 评论(0) 推荐(0)