12 2019 档案

摘要:#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 张茗凯 阅读(189) 评论(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 张茗凯 阅读(115) 评论(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 张茗凯 阅读(109) 评论(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)