摘要: Part 1 // 从文本文件file1.dat中读取数据,找出最高分和最低分学生信息,并输出在屏幕上 #include <stdio.h> #include <stdlib.h> #define N 10 // 定义一个结构体类型STU typedef struct student { int n 阅读全文
posted @ 2019-12-31 22:20 吴梦茹 阅读(156) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; 阅读全文
posted @ 2019-12-21 13:36 吴梦茹 阅读(135) 评论(2) 推荐(0)
摘要: Part 1 ABCDEFGPart 2// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, 阅读全文
posted @ 2019-12-17 23:18 吴梦茹 阅读(155) 评论(2) 推荐(0)
摘要: //寻找两个整数之间的所有素数(包括这两个整数),把结果保存在数组bb中,函数返回素数的个数。 // 例如,输入6和21,则输出为:7 11 13 17 19。 #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,i 阅读全文
posted @ 2019-12-02 22:03 吴梦茹 阅读(141) 评论(1) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf("输入第%d个数: ", n); scanf("%d", &number); max = number; min = nu 阅读全文
posted @ 2019-11-17 23:01 吴梦茹 阅读(164) 评论(0) 推荐(0)
摘要: 有些数字前多了空格,改变了其输出值的宽度和精度 123.456001,123.5,123.46,1.23e+002与初始值不一致, 原因: 计算机中采用二进制,输入数只能四舍五入的转化为二进制存储,取出时无法还原,出现了浮点数的精确度问题。 Hello,world!后三个与初始值不一致。 原因: . 阅读全文
posted @ 2019-11-03 22:57 吴梦茹 阅读(186) 评论(1) 推荐(0)
摘要: 实验总结与体会 第一次做实验操作不熟 容易漏打字母 字符又不经意间多加了分号 但过程熟悉了之后打代码就很顺手也能较好地掌握格式 但有些字符还不大会用 我自己本人会在这一块上多下功夫,结合上课所学争取早日应用。 阅读全文
posted @ 2019-10-19 23:57 吴梦茹 阅读(172) 评论(0) 推荐(0)