摘要: 实验任务4 #include <stdio.h> #include <ctype.h> int main() { FILE *fp; char ch; int line_count = 0; int char_count = 0; fp=fopen("C:\\Users\\li\\Downloads 阅读全文
posted @ 2025-12-31 20:12 |l| 阅读(10) 评论(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-25 21:18 |l| 阅读(5) 评论(1) 推荐(0)
摘要: 实验任务1 1.函数find-min-max的功能是找到一维数组中的最大值和最小值 2.分别指向主函数中定义的变量min和max的内存地址 1.找到数组x中最大值所在的下标同时返回其对应的数组元素 2.不可以。理由ptr是int*类型而x[i]是int类型,不能将x[i]赋值给ptr 实验任务2 1 阅读全文
posted @ 2025-12-12 15:19 |l| 阅读(11) 评论(1) 推荐(0)
摘要: 实验任务1 一维数组x在内存中连续存放,x和&x的值相同 二维数组x在内存中按行连续存放,x,x{0},x【0】【0】的值相同,x{0}和x{1}相差16.该值的含义是x{0}与x{1}之间相差4个字节 实验任务2 形参为在函数input(int x[ ],int n)的定义中的int x[ ],实 阅读全文
posted @ 2025-11-16 21:22 |l| 阅读(15) 评论(1) 推荐(0)
摘要: 实验任务1 问题1:作用是根据输入的分数对应相应的等级。形参类型是整数型,返回值类型是字符型 问题2:更改后代码的问题是:1.输入的分数会对应输出对应的等级以及对应等级以下的等级。 2.更改后的代码没有返回值。 实验任务2 问题1:功能是让输入的n值有相应的ans值。 #include <stdio 阅读全文
posted @ 2025-10-30 19:06 |l| 阅读(9) 评论(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_ 阅读全文
posted @ 2025-10-14 15:50 |l| 阅读(11) 评论(1) 推荐(0)
摘要: 实验任务1 #include <stdio.h>int main(){ printf(" o\n"); printf("<H>\n"); printf("I I\n"); printf(" o\n"); printf(" o\n"); printf("<H>\n"); printf("I I\n") 阅读全文
posted @ 2025-10-06 18:02 |l| 阅读(23) 评论(1) 推荐(0)