摘要: ex3 在当前文件夹可以找到文本文件file3.dat 信息正确且直观可读 ex4 子任务1 在当前路径下生成了数据文件file4.dat 但是其中的数据并不是清晰可读的。(因为创建的是二进制数据文件) #include<stdio.h> #include <stdlib.h> #define N 阅读全文
posted @ 2020-12-31 12:42 yourknight 阅读(62) 评论(1) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 4 typedef struct student { int id; char name[20]; char subject[20]; float perf; floa 阅读全文
posted @ 2020-12-24 20:48 yourknight 阅读(60) 评论(2) 推荐(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-16 21:32 yourknight 阅读(87) 评论(2) 推荐(0)
摘要: #include <stdio.h> long long fun(int n); int main() { int n; long long f; while(scanf("%d", &n) != EOF) { f = fun(n); printf("n = %d, f = %lld\n", n, 阅读全文
posted @ 2020-11-29 22:50 yourknight 阅读(68) 评论(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-15 16:52 yourknight 阅读(76) 评论(2) 推荐(0)
摘要: #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; } d=a/b的整 阅读全文
posted @ 2020-11-01 11:51 yourknight 阅读(56) 评论(2) 推荐(0)
摘要: 实验二 /* 循环打印字符 */ #include <stdio.h> int main() { while(1) printf("lbwnb"); return 0; } 修改 实验三 #include <stdio.h> int main() { int x, y; int r1, r2, r3 阅读全文
posted @ 2020-10-15 19:48 yourknight 阅读(107) 评论(2) 推荐(0)