摘要: EX3 ANS:输出了按分数由高→低排序的信息;生成了文本文件file3.dat;数据信息正确且直观可读 EX4_1 ANS:输出了按分数由高到低排序的信息;生成了二进制文件file4.dat;But,除了名字正确以外,学号是“?”,成绩是熟悉的“烫烫烫烫” EX4_2 //EX4_2 #inclu 阅读全文
posted @ 2020-12-27 16:51 热心市民小杨 阅读(106) 评论(2) 推荐(0)
摘要: EX1 //ex1 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 2 typedef struct student { int id; //学生学号 char name[20]; //学生姓名 char subje 阅读全文
posted @ 2020-12-17 23:23 热心市民小杨 阅读(83) 评论(0) 推荐(0)
摘要: 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: %d\n", & 阅读全文
posted @ 2020-12-16 17:24 热心市民小杨 阅读(109) 评论(1) 推荐(0)
摘要: EX1 ans:不能。因为 solve 函数返回值类型为 void,不能返回数值。将 void solve 声明及定义改为 double solve 再返回值即可。 EX2 //ex2_1 // 利用局部static变量计算阶乘 #include <stdio.h> #include <stdlib 阅读全文
posted @ 2020-11-29 15:32 热心市民小杨 阅读(110) 评论(2) 推荐(0)
摘要: EX1 // 一元二次方程求解 // 重复执行, 直到按Ctrl+Z结束 #include <stdio.h> #include <math.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a 阅读全文
posted @ 2020-11-17 17:07 热心市民小杨 阅读(117) 评论(1) 推荐(0)
摘要: EX1 //ex1 #include <stdio.h> #include <stdlib.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( 阅读全文
posted @ 2020-11-01 13:49 热心市民小杨 阅读(80) 评论(1) 推荐(0)
摘要: 任务一 /*Trial1-A simple C program*/ #include<stdio.h> #include<stdlib.h> int main() { printf_s("my stuno is:202083450087\n2020,i will be better!\n"); sy 阅读全文
posted @ 2020-10-16 21:33 热心市民小杨 阅读(116) 评论(0) 推荐(0)