摘要: 实验三、 正确由高到低排序,生成了file3.dat,数据信息正确且可观 实验四、 1.正确分数由高到低排序,生成file4.dat,数据信息不直观可读 2. #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct stu 阅读全文
posted @ 2021-01-01 11:20 海科zhh 阅读(49) 评论(1) 推荐(0) 编辑
摘要: 实验一 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student { int id; char name[20]; char subject[20]; float perf; 阅读全文
posted @ 2020-12-21 22:35 海科zhh 阅读(53) 评论(2) 推荐(0) 编辑
摘要: 实验1 #include<stdio.h> const int N = 3; int main() { int a[N] = { 1,2,3 }; int i; printf("通过数组名及下标直接访问数组元素:\n"); for (i = 0; i < N; i++) printf("%d:%d\ 阅读全文
posted @ 2020-12-17 21:13 海科zhh 阅读(48) 评论(2) 推荐(0) 编辑
摘要: 一、 一元二次方程的根可以设计成以函数返回值的方式返回给主调函数。 随时改变的值可以设置成参数。 二、 #include <stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n: "); scanf("%d", &n 阅读全文
posted @ 2020-12-06 10:00 海科zhh 阅读(58) 评论(2) 推荐(0) 编辑
摘要: #include <math.h> #include <stdio.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); while(scanf("%f%f%f", &a, 阅读全文
posted @ 2020-11-19 22:12 海科zhh 阅读(36) 评论(2) 推荐(0) 编辑
摘要: //ex1.cpp #include<stdio.h> int main(){ int a=5,b=7,c=100,d,e,f; d=a/b*c; e=a*c/b; f=c/b*a; printf("d=%d,e=%d,f=%d\n",d,e,f); return 0; } 从左到右运算顺序不同,% 阅读全文
posted @ 2020-11-05 23:28 海科zhh 阅读(66) 评论(2) 推荐(0) 编辑
摘要: 一 二 三 四 阅读全文
posted @ 2020-10-18 21:25 海科zhh 阅读(36) 评论(0) 推荐(0) 编辑