摘要: 一:实验结论: 3:屏幕上是正确输出了按分数由高→低排序的信息; 同时,在当前路径下,是 生成了文本文件file3.dat; 用记事本程序打开文件file3.dat,里面的数据信息是正确的,并且直观可读。 4:子任务1:验证性任务: 运行程序,屏幕上正确输出了按分数由高到底排序的学生信息; 同时,在 阅读全文
posted @ 2021-06-15 11:40 Dictator——博客 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 一:实验结论: 1:验证性任务1: (1)源代码: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student{ int id; //学号 char name[20]; //姓名 阅读全文
posted @ 2021-06-10 08:07 Dictator——博客 阅读(33) 评论(2) 推荐(0) 编辑
摘要: 一:实验结论: 1:验证性任务1: (1)源代码: #include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++ 阅读全文
posted @ 2021-05-27 09:06 Dictator——博客 阅读(35) 评论(2) 推荐(0) 编辑
摘要: 一:实验结论: 1:设n取值范围在0~32之间。设计一个函数模块fun(),用来实现: 提供n的数值,返回该函数计算式 的结果。 要求:使用递归算法实现 不允许使用标准库函数pow()。 (1)源代码: #include <stdio.h> long long fun(int n); int mai 阅读全文
posted @ 2021-04-29 07:57 Dictator——博客 阅读(97) 评论(1) 推荐(0) 编辑
摘要: 一:实验结论: 1:生成N个0~99之间的随机整数,并打印输出。 (1)源代码: #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int x, n; srand(time(0)); f 阅读全文
posted @ 2021-04-15 12:41 Dictator——博客 阅读(64) 评论(2) 推荐(0) 编辑
摘要: 一:实验结论 1:(1)源代码 //格式化输入,输出函数的简单应用 #include <stdio.h> int main (){ int num; scanf ("%d",&num); printf("2049%04d\n",num); scanf ("%d",&num); printf("204 阅读全文
posted @ 2021-03-30 16:08 Dictator——博客 阅读(59) 评论(3) 推荐(0) 编辑