2019年12月31日

摘要: 《实验七》 验证性实验1: 验证性内容2: 验证性内容3: 验证性内容4: 以二进制形式存入file4.dat后,内容不可以直接读出 编程练习: #include <stdio.h>#include <stdlib.h>#include <string.h>const int N = 5;typed 阅读全文
posted @ 2019-12-31 16:55 北米酒 阅读(95) 评论(2) 推荐(0) 编辑

2019年12月22日

摘要: 1.1 验证性内容 将数组大小N改为3后,测试内容及结果如下: 1.2 补足的程序段为: int findMinlist(STU s[], STU t[], int n) { int i,j,min,p; min=s[0].score; p=0; for(i=0;i<N-1;i++) { if(mi 阅读全文
posted @ 2019-12-22 22:41 北米酒 阅读(59) 评论(2) 推荐(0) 编辑

2019年12月17日

摘要: 《实验五》 一、验证性内容 1.1 在替换部分代码后,代码及运行结果如下: 解释:将第七行中的数组类型修改为字符型数组后,对应的输出行的元素类型均需要修改为%c而不再是%d。 并且&a[i]和a+i扔代表a[i]的地址,所以第十八行仍可以通过指针间接访问。 2.2 1.3 1.4 在替换第12行的代 阅读全文
posted @ 2019-12-17 09:11 北米酒 阅读(148) 评论(2) 推荐(0) 编辑

2019年12月2日

摘要: 《实验四》 #include<stdio.h>#include<math.h>#include<stdlib.h> void jfc(double a,double b,double c);int main(){ double a,b,c; printf("请输入一元二次方程组的系数a,b,c: " 阅读全文
posted @ 2019-12-02 21:40 北米酒 阅读(144) 评论(2) 推荐(0) 编辑

2019年11月18日

摘要: 《一元二次方程》 #include <math.h>#include <stdio.h>#include <stdlib.h>int main() { float a, b, c, x1, x2; float delta, real, imag; printf("请输入一元二次方程的系数a,b,c: 阅读全文
posted @ 2019-11-18 23:26 北米酒 阅读(100) 评论(0) 推荐(0) 编辑

2019年11月5日

摘要: 实验一第一部分:理解各种数据类型的意义及各种输出方式 #include<stdio.h>int main(){ int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello World!"; int y=3,z 阅读全文
posted @ 2019-11-05 21:50 北米酒 阅读(106) 评论(1) 推荐(0) 编辑

2019年10月20日

摘要: 《判断奇偶实验代码》 #include <stdio.h>#include <stdlib.h>int main(){ int x; printf("输入一个整数:\n"); scanf("%d",&x); if(x%2==1) printf("是奇数"); else printf("是偶数"); 阅读全文
posted @ 2019-10-20 16:27 北米酒 阅读(93) 评论(0) 推荐(0) 编辑