摘要: #include<stdio.h> #define N 5 typedef struct student{ long no; char name[20]; int score; }STU; void input(STU s[], int n); int findMinlist(STU s[], ST 阅读全文
posted @ 2021-12-28 17:59 *惜往日 阅读(26) 评论(0) 推荐(0) 编辑
摘要: task1 #include <stdio.h> #define N 5 int binarySearch(int *x, int n, int item); // 函数声明 int main() { int a[N] = {2, 7, 19, 45, 66}; int i, index, key; 阅读全文
posted @ 2021-12-16 16:31 *惜往日 阅读(22) 评论(0) 推荐(0) 编辑
摘要: task1 #include <stdio.h> #define N 5 void output(int x[], int n); int main() { int x[N] = {9, 55, 30, 27, 22}; int i; int k; // 用于记录最大元素的下标 int t; // 阅读全文
posted @ 2021-12-13 18:53 *惜往日 阅读(14) 评论(0) 推荐(0) 编辑
摘要: task1 #include <stdio.h> const int N = 4; int main() { int a[N] = {2, 0, 2, 1}; // 定义一个int型数组a,包含N个元素 char b[N] = {'2', '0', '1', '1'}; // 定义一个char型数组 阅读全文
posted @ 2021-12-02 19:36 *惜往日 阅读(10) 评论(1) 推荐(0) 编辑
摘要: task1 #include<stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n: "); scanf("%d", &n); for (i=1;i<=n;++i) printf("%d! = %11d\n",i,f 阅读全文
posted @ 2021-11-28 19:04 *惜往日 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { int num; scanf("%d",&num); printf("2049%04d\n",num); scanf("%d",&num); printf("2049%04d\n",num); scanf("%d",&num); prin 阅读全文
posted @ 2021-11-11 20:33 *惜往日 阅读(17) 评论(2) 推荐(0) 编辑
摘要: 1.实验任务1 2.实验任务2 r4 值不同的原因:第一次是整型数据忽略小数点后的数据,第二次是浮点型数据,显示小数点后的数据。 3.实验任务3 7:101*102/2;8:102*101/2;9:101/2*102=50*102;10:102/2*101 奇数在/2时失去小数部分而变小。 4.实验 阅读全文
posted @ 2021-10-30 09:41 *惜往日 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 1.实验任务1 2.实验任务2 r4 值不同的原因:第一次是整型数据忽略小数点后的数据,第二次是浮点型数据,显示小数点后的数据。 3.实验任务3 4.实验任务4 5.实验任务5 6.实验任务6 阅读全文
posted @ 2021-10-28 20:45 *惜往日 阅读(31) 评论(0) 推荐(0) 编辑