摘要: //ex1 仅验证 //ex2 仅验证 //ex3 运行程序,屏幕上正确地输出了按分数由高到低的排序,同时在当前路径下生成了文本文件file3.dat,用记事本打开,里面的数据是正确的,且是直观可读的。 //ex4 子任务1 运行程序,屏幕上出现了正确的信息,同时生成了二进制文件file4.dat, 阅读全文
posted @ 2020-12-29 23:04 琪汐 阅读(62) 评论(1) 推荐(0)
摘要: //ex1 // ex1 // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define 阅读全文
posted @ 2020-12-21 14:32 琪汐 阅读(76) 评论(0) 推荐(0)
摘要: //ex1 //ex1 #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: % 阅读全文
posted @ 2020-12-16 16:43 琪汐 阅读(114) 评论(0) 推荐(0)
摘要: //实验1 不能,因为函数只能返回一个值 //实验2 //实验2 //利用局部static变量计算阶乘 #include<stdio.h> long long fac(int n); //函数声明 int main(){ int i, n; printf("Enter n:"); scanf("%d 阅读全文
posted @ 2020-12-01 14:19 琪汐 阅读(84) 评论(0) 推荐(0)
摘要: //实验1 //一元二次方程求解 //重复执行,直到Ctrl+Z结束 // #include<math.h> #include<stdio.h> int main(){ float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, 阅读全文
posted @ 2020-11-14 10:50 琪汐 阅读(100) 评论(0) 推荐(0)
摘要: //ex1.cpp //ex1.cpp #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-11-01 15:18 琪汐 阅读(89) 评论(1) 推荐(0)
摘要: 实验结论 实验1 /*A simple C program*/ #include <stdio.h> int main(){ printf("my stuno is:202083290290\n"); printf("2020,I hate you!"); return 0; } 实验2 (1) / 阅读全文
posted @ 2020-10-16 14:10 琪汐 阅读(66) 评论(0) 推荐(0)