摘要: text3 正确输出了按分数由高→低排序的信息, 在当前路径下,生成了文本文件file3.dat 用记事本程序打开文件file3.dat,里面的数据信息是正确的,并且是直观可读的 text4 #include <stdio.h> #include <stdlib.h> #define N 10 // 阅读全文
posted @ 2021-01-01 15:13 加拉帕鸽斯 阅读(52) 评论(0) 推荐(0) 编辑
摘要: Task1 // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 阅读全文
posted @ 2020-12-25 12:47 加拉帕鸽斯 阅读(25) 评论(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-17 23:06 加拉帕鸽斯 阅读(50) 评论(0) 推荐(0) 编辑
摘要: ex1 1.函数声明可以放main函数前也可以是后,由 返回值类型(不需要用void) 函数名 (形参)构成 形参可以是变量,字符,数列 根不能设计成函数返回值的方式给主调函数 2.x1,x2 3.把函数声明去掉,将其余加入double a,b,c;后 // 一元二次方程求解 (函数实现方式) // 阅读全文
posted @ 2020-12-04 00:37 加拉帕鸽斯 阅读(98) 评论(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,b,c: " 阅读全文
posted @ 2020-11-20 13:53 加拉帕鸽斯 阅读(52) 评论(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",d,e,f); return 0; } d=a/b*c=5/7*100=0 e= 阅读全文
posted @ 2020-11-02 00:03 加拉帕鸽斯 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 实验任务一 #include<stdio.h> int main(){ printf("加拉帕戈斯"); return 0; } 实验任务二 line5 #include<stdio.h> int main(){ while (1) printf("8 1"); return 0; } line4 阅读全文
posted @ 2020-10-18 11:25 加拉帕鸽斯 阅读(35) 评论(0) 推荐(0) 编辑