摘要: 任务三 运行程序,观察在屏幕上是否正确输出了按分数由高→低排序的信息?同时,在当前路径下,是 否生成了文本文件file3.dat? 是 尝试用记事本程序打开文件file3.dat,观察里面的数据信息是否是正确的,并且是直观可读的? 正确 任务四 运行程序,观察在屏幕上是否正确输出了按分数由高到底排序 阅读全文
posted @ 2020-12-27 21:26 ignored 阅读(67) 评论(1) 推荐(0) 编辑
摘要: 任务一 // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行 阅读全文
posted @ 2020-12-20 15:54 ignored 阅读(110) 评论(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", & 阅读全文
posted @ 2020-12-14 17:26 ignored 阅读(66) 评论(0) 推荐(0) 编辑
摘要: 任务一 不能用函数返回值方式返回给主函数,方程有两根而返回值只能有一个 任务二 // 利用局部static变量计算阶乘 #include <stdio.h> long long fac(int n); // 函数声明 int main() { int i,n; printf("Enter n: ") 阅读全文
posted @ 2020-11-29 16:00 ignored 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 任务一 #include <stdio.h> #include <math.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) 阅读全文
posted @ 2020-11-16 17:50 ignored 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 任务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; } d=ac/b e=aac/b f= 阅读全文
posted @ 2020-10-31 19:18 ignored 阅读(138) 评论(1) 推荐(0) 编辑
摘要: 任务1 /*A simple C program */ #include <stdio.h> int main(){ printf("my stuno is:202083450086\n"); printf("2020,we need to fight.\n"); return 0; } 任务2 / 阅读全文
posted @ 2020-10-16 20:09 ignored 阅读(154) 评论(0) 推荐(0) 编辑