摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; 阅读全文
posted @ 2019-12-29 12:31 张茗凯 阅读(187) 评论(3) 推荐(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 14:14 张茗凯 阅读(113) 评论(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 23:17 张茗凯 阅读(108) 评论(3) 推荐(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-01 23:32 张茗凯 阅读(129) 评论(2) 推荐(0)
摘要: /* 编程找出5个整数的最大数和最小数 《C语言程序设计教程学习指导》p122实验内容(3) */ #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf("输入第%d个数: " 阅读全文
posted @ 2019-11-18 11:35 张茗凯 阅读(149) 评论(3) 推荐(0)
摘要: PART 1 1.运行结果不一致 2. 原因1.缺少地址码 2.双精度要用%lf PART 2 2. 3. 实验总结:part1部分 第一个实验有的地方仍为搞懂,只能找出部分,并未能完全解决问题 part3部分 在开始时对if else的使用以及括号是写在里面还是写在外面并不是很熟练 在编写正序和逆 阅读全文
posted @ 2019-11-04 22:03 张茗凯 阅读(148) 评论(3) 推荐(0)
摘要: 实验结论: 实验总结与体会: 第一次尝试做不是很熟练,感觉对于知识并不能充分理解并运用,编写时很多错误不知道错在哪里,包括写出来的也不是很明白为什么要这样写,还可以怎么写。 阅读全文
posted @ 2019-10-20 13:42 张茗凯 阅读(213) 评论(1) 推荐(0)