摘要: 实验任务三:运行程序,在屏幕上正确输出了按分数由高->低排序的信息,同时,生成文本文件file3.dat 用记事本程序打开文件file3.dat,里面的数据信息是正确的,并且是直观可读的 实验任务四:子任务1:运行程序,观察在屏幕上正确输出了按分数由高到底排序的学生信息,生成了文件,但是不可读 子任 阅读全文
posted @ 2021-01-01 12:05 lyΠ 阅读(53) 评论(2) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student { int id; /*学生学号 */ char name[20]; /*学生姓名 */ char subject[2 阅读全文
posted @ 2020-12-25 12:42 lyΠ 阅读(50) 评论(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", &a[i] 阅读全文
posted @ 2020-12-18 12:23 lyΠ 阅读(42) 评论(0) 推荐(0) 编辑
摘要: // 一元二次方程求解 (函数实现方式) // 重复执行, 直到按Ctrl+Z结束 #include <math.h> #include <stdio.h> // 函数声明 void solve(double a, double b, double c); // 主函数 int main() { d 阅读全文
posted @ 2020-12-03 17:15 lyΠ 阅读(59) 评论(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, & 阅读全文
posted @ 2020-11-18 17:13 lyΠ 阅读(81) 评论(0) 推荐(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; } #includ 阅读全文
posted @ 2020-11-06 09:09 lyΠ 阅读(118) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> int main() { printf("My stuno is 202083450075\n"); printf("我对2020想说的话:2020再创佳绩\n"); system("pause"); return 0; } 阅读全文
posted @ 2020-10-18 21:05 lyΠ 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { float x,y; float r1,r2,r3,r4; x=1; y=2; r1=x+y; r2=x-y; r3=x*y; r4=x/y; printf("r1=%f\n",r1); printf("r2=%f\n",r2); pri 阅读全文
posted @ 2020-10-16 18:51 lyΠ 阅读(49) 评论(0) 推荐(0) 编辑