摘要: 3.正确输出按分数由高到低排序的信息;是。 数据正确,直观可读。 4.任务一:正确输出分数由高到低排序的信息;是;不直观可读。 任务二 // 从文本数据文件file4.dat中读入数据,输出到屏幕上 #include <stdio.h> #include <stdlib.h> #define N 1 阅读全文
posted @ 2020-12-29 15:55 涂涂不吃葱 阅读(70) 评论(2) 推荐(0)
摘要: // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入 阅读全文
posted @ 2020-12-21 14:42 涂涂不吃葱 阅读(79) 评论(2) 推荐(0)
摘要: #include <stdio.h> const int N=3; int main() { int a[3] = {1, 2, 3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a[i] 阅读全文
posted @ 2020-12-15 23:30 涂涂不吃葱 阅读(91) 评论(2) 推荐(0)
摘要: 1.不能。一元二次方程有两个根,而return只能返回一个值。 2. // 利用局部static变量计算阶乘 #include <stdio.h> long long fac(int n); // 函数声明 int main() { int i,n; printf("Enter n: "); sca 阅读全文
posted @ 2020-12-05 17:30 涂涂不吃葱 阅读(42) 评论(2) 推荐(0)
摘要: //一元二次方程求解 //重复执行,直到按Ctrl+Z结束 // #include<math.h> #include<stdio.h> int main(){ float a,b,c,x1,x2; float delta,real,imag; printf("Enter a,b,c: "); whi 阅读全文
posted @ 2020-11-17 22:51 涂涂不吃葱 阅读(102) 评论(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; } #include<stdio.h> int 阅读全文
posted @ 2020-10-31 16:16 涂涂不吃葱 阅读(86) 评论(2) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> int main(){ printf("我的学号;202083290277\n你别认输,天黑后就是日出"); system("pause"); return 0; } /*循环打印字符*/ #include<stdio.h> 阅读全文
posted @ 2020-10-17 13:27 涂涂不吃葱 阅读(70) 评论(2) 推荐(0)