摘要: // 从文本文件file1.dat中读取数据,找出最高分和最低分学生信息,并输出在屏幕上 #include <stdio.h> #include <stdlib.h> #define N 10 // 定义一个结构体类型STU typedef struct student { int num; cha 阅读全文
posted @ 2019-12-30 10:32 唐世祥 阅读(124) 评论(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 15:59 唐世祥 阅读(86) 评论(3) 推荐(0)
摘要: 2-1-1: // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 阅读全文
posted @ 2019-12-16 22:07 唐世祥 阅读(116) 评论(2) 推荐(0)
摘要: 1. #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,int m,int bb[N]) { int i,j,k=0,flag; for(j=n;j<=m;j++) { flag=1; for(i=2;i<j;i+ 阅读全文
posted @ 2019-11-29 00:40 唐世祥 阅读(114) 评论(3) 推荐(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-16 23:27 唐世祥 阅读(98) 评论(2) 推荐(0)
摘要: part1 ex2_1: 1.浮点数在储存时为近似值,所以小数后会多一 2.修饰符m,输出数据域宽,数据长度小于m,左补空格,否则输出实际值 3. .n ,对实数指定小数点后位数(四舍五入),对字符串指定实际输出位数 ex2_2: scanf函数后要加寻址符&,定义double x,y 必须用lf% 阅读全文
posted @ 2019-11-03 13:43 唐世祥 阅读(141) 评论(3) 推荐(0)
摘要: 实验总结:函数不熟,操作僵硬,需多练习。 阅读全文
posted @ 2019-10-20 12:28 唐世祥 阅读(88) 评论(0) 推荐(0)