摘要: 3. 输出了按分数由高→低排序的信息;生成了文本文件file3.dat;数据信息正确且直观可读 4. (1) 屏幕上正确输出了按分数由高到底排序的学生信息,生成了二进制文件file4.dat。 用记事本打开文件,不直观可读。 (2) #include <stdio.h> #include <stdl 阅读全文
posted @ 2020-12-28 09:03 张白枫 阅读(60) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <string.h> #define N 3 //Task 1 typedef struct student { int id; char name[20]; char subject[20]; float perf; float mid; f 阅读全文
posted @ 2020-12-25 00:00 张白枫 阅读(34) 评论(1) 推荐(0) 编辑
摘要: #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\n", &a[i] 阅读全文
posted @ 2020-12-17 21:06 张白枫 阅读(38) 评论(1) 推荐(0) 编辑
摘要: 任务一 应该是不能的,return返回来是一个值,而根可能有2个 任务2 #include <stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n: "); scanf("%d", &n); for(i=1; i<= 阅读全文
posted @ 2020-12-06 15:42 张白枫 阅读(52) 评论(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("% 阅读全文
posted @ 2020-11-18 16:36 张白枫 阅读(55) 评论(2) 推荐(0) 编辑
摘要: //ex1 #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); getchar(); return 0; } int定 阅读全文
posted @ 2020-10-30 16:22 张白枫 阅读(76) 评论(2) 推荐(0) 编辑
摘要: //a simple c program #include<stdio.h> int main(){ printf("202083450090\n"); printf("lazy,crazy,angry"); return 0; } //循环打印字符 #include<stdio.h> int ma 阅读全文
posted @ 2020-10-19 17:24 张白枫 阅读(48) 评论(0) 推荐(0) 编辑