摘要: 实验三:是 实验四: 屏幕正确输出信息,生成文件file4.dat,不直观可读 #include<stdio.h> #include<stdlib.h> #define N 10 typedef struct student { int num; char name[20]; int score; 阅读全文
posted @ 2020-12-31 14:31 孟豆 阅读(42) 评论(1) 推荐(0) 编辑
摘要: 实验一: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; /*学生学号 */ char nam 阅读全文
posted @ 2020-12-25 07:35 孟豆 阅读(31) 评论(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", 阅读全文
posted @ 2020-12-17 07:32 孟豆 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 实验1:我认为不可以,因为函数的返回值具有唯一性。 实验2: #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 阅读全文
posted @ 2020-12-01 10:05 孟豆 阅读(53) 评论(1) 推荐(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,&b,&c)!=EOF) 阅读全文
posted @ 2020-11-15 03:06 孟豆 阅读(93) 评论(1) 推荐(0) 编辑
摘要: 1.实验任务1 #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-10-31 10:13 孟豆 阅读(59) 评论(3) 推荐(0) 编辑
摘要: 实验一 #include<stdio.h> int main() { printf("my stuno is202083450053 . 2020,cool"); return 0; } 实验二: #include<stdio.h> int main() { while (1) printf("Fi 阅读全文
posted @ 2020-10-17 13:14 孟豆 阅读(34) 评论(0) 推荐(0) 编辑