摘要: part1 仍然正确 // 从文本文件file1.dat中读取数据,找出最高分和最低分学生信息,并输出在屏幕上 #include <stdio.h> #include <stdlib.h> #define N 10 // 定义一个结构体类型STU typedef struct student { i 阅读全文
posted @ 2019-12-29 23:26 江上清风游城 阅读(138) 评论(1) 推荐(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-22 22:14 江上清风游城 阅读(138) 评论(2) 推荐(0)
摘要: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i 阅读全文
posted @ 2019-12-17 12:39 江上清风游城 阅读(106) 评论(2) 推荐(0)
摘要: Blank1 //寻找两个整数之间的所有素数(包括这两个整数),把结果保存在数组bb中,函数返回素数的个数。 // 例如,输入6和21,则输出为:7 11 13 17 19。 #include <stdio.h> #include <stdlib.h> #define N 1000 int fun( 阅读全文
posted @ 2019-12-03 22:40 江上清风游城 阅读(129) 评论(1) 推荐(0)
摘要: Part2:补足程序 /* 编程找出5个整数的最大数和最小数 《C语言程序设计教程学习指导》p122实验内容(3) */ #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf( 阅读全文
posted @ 2019-11-18 22:52 江上清风游城 阅读(167) 评论(1) 推荐(0)
摘要: Part1 一、部分变量的值与代码中赋给变量的初始值不一致。 分析解释: //输出123.456001是计算机中采用二进制,输入数只能转化为二进制数存储,输出时就不能将原本的十进制123.456输出; //输出123.5是%8.1f保留一位小数; //2e是用科学计数法表示且保留小数点后两位; // 阅读全文
posted @ 2019-11-04 23:39 江上清风游城 阅读(118) 评论(4) 推荐(0)
摘要: 实验一 阅读全文
posted @ 2019-10-21 23:42 江上清风游城 阅读(176) 评论(0) 推荐(0)