摘要: 实验一: #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define N 80 #define M 100 typedef struct { char name[N]; // 书名 char author[N]; // 作者 } Book; 阅读全文
posted @ 2025-06-08 10:18 wangchenxu 阅读(19) 评论(0) 推荐(0)
摘要: 实验1 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #define N 2 typedef struct student { int id; char name[20]; char subject[20 阅读全文
posted @ 2025-06-02 10:39 wangchenxu 阅读(15) 评论(0) 推荐(0)
摘要: 实验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-05-17 17:42 wangchenxu 阅读(10) 评论(0) 推荐(0)
摘要: 实验1: question1:是连续存放。数组名x对应的值,和&x[0]是一样的。 question2:int型⼆维数组x,在内存中是"按⾏连续存放"的。 数组名x的值、x[0]、&x[0][0]值是⼀样。 x[0]和x[1]相差16字节。这个差值表示二维数组x每行占用的字节数。 实验2: #inc 阅读全文
posted @ 2025-04-21 12:21 wangchenxu 阅读(14) 评论(0) 推荐(0)
摘要: 实验1 ans1:将分数转化为对应的等地;整型;字符型; ans2:缺少break时,最终都是E 实验2 ans:累加上面的数据 ans2:相同,一个是累加,一个是递归 实验3 ans1:实现x的n次方的计算 ans2::当n=0时,power(x)=0;n为奇,power(x)=x*power(x 阅读全文
posted @ 2025-04-09 23:05 wangchenxu 阅读(9) 评论(0) 推荐(0)
摘要: 实验1 ans1:将分数转化为对应的等地;整型;字符型; ans2:缺少break时,最终都是E 实验2 ans:累加上面的数据 ans2:相同,一个是累加,一个是递归 实验3 ans1:实现x的n次方的计算 ans2::当n=0时,power(x)=0;n为奇,power(x)=x*power(x 阅读全文
posted @ 2025-04-09 23:05 wangchenxu 阅读(7) 评论(0) 推荐(0)
摘要: task1 问题1: 生成1到100以内的整数 问题2: 使number生成4位不够用0补充 问题3: 随机生成一个学号 task2 问题1: total如果去掉,那么下一次循环total就是上一次循环的结果 问题2:break直接结束循环,continue是跳过本次循环继续下一次循环 问题3: 没 阅读全文
posted @ 2025-03-22 19:37 wangchenxu 阅读(10) 评论(0) 推荐(0)
摘要: 1 2 3 4 5 // 计算10亿秒约等于多少年,并打印输出 #include <stdio.h> int main() { int year; // 补足代码 year = 1000000000 / 365 / 24 / 60 / 60; printf("10亿秒约等于%d年\n", year) 阅读全文
posted @ 2025-03-09 21:41 wangchenxu 阅读(13) 评论(0) 推荐(0)