摘要: 实验任务三: 运行程序,在屏幕上正确输出了按分数由高->低排序的信息,同时,生成文本文件file3.dat 用记事本程序打开文件file3.dat,里面的数据信息是正确的,并且是直观可读的 实验任务四: 1.运行程序,在程序上正确输出了按分数由高到低排序的学生信息,同时,生成了二进制文件file4. 阅读全文
posted @ 2020-12-31 17:36 成洺萱 阅读(93) 评论(1) 推荐(0) 编辑
摘要: 实验一: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student { int id; /*学生学号 */ char name[20]; /*学生姓名 */ char subj 阅读全文
posted @ 2020-12-24 10:42 成洺萱 阅读(52) 评论(1) 推荐(0) 编辑
摘要: 实验任务1: #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 20:57 成洺萱 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 实验一: 在这个应用中,一元二次方程的根可以设计成以函数返回值的方式返回给主调函数。 因为随时改变的值可以设置成参数。 实验二: (1) // 利用局部static变量计算阶乘 #include <stdio.h> long long fac(int n); // 函数声明 int main() { 阅读全文
posted @ 2020-12-02 16:39 成洺萱 阅读(69) 评论(0) 推荐(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:"); while(scanf(" 阅读全文
posted @ 2020-11-18 22:51 成洺萱 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1.实验任务1 ·程序源代码 //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-10-31 00:30 成洺萱 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 实验结论 1.实验任务1 程序源代码 /*A simple C program*/ #include<stdio.h> int main(){ printf("my stuno is:202083450074\n"); printf("2020,r u crazy?"); return 0; } 运 阅读全文
posted @ 2020-10-16 19:30 成洺萱 阅读(99) 评论(0) 推荐(0) 编辑