摘要: Part1 1. 验证性实验2 正确 2.验证性实验4 二进制文件的读取 #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct student { int num; char name[20]; int score; } 阅读全文
posted @ 2019-12-29 11:06 姚蔚奇 阅读(114) 评论(3) 推荐(0)
摘要: Part1 1. #include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; in 阅读全文
posted @ 2019-12-19 21:55 姚蔚奇 阅读(126) 评论(3) 推荐(0)
摘要: Part 1 1. A E F Part2 1.ex2_1_1.cpp // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch( 阅读全文
posted @ 2019-12-15 11:25 姚蔚奇 阅读(109) 评论(3) 推荐(0)
摘要: 1. #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,int m,int bb[N]) { int i,j,k=0,flag; for(j=n;j<=m;j++) { flag=1; for(i=2;i<j;i+ 阅读全文
posted @ 2019-11-29 16:26 姚蔚奇 阅读(141) 评论(2) 推荐(0)
摘要: Part2 补足代码 /* 编程找出5个整数的最大数和最小数 《C语言程序设计教程学习指导》p122实验内容(3) */ #include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf( 阅读全文
posted @ 2019-11-16 13:16 姚蔚奇 阅读(66) 评论(1) 推荐(0)
摘要: part1:格式化输入函数和格式化输出函数 1. line16:%8d控制输出宽度,不足的以空格补齐。 %2d小于原数据宽度故不变 line17: %8.1f表示宽度为8,小数保留一位;%0.2f表示小数保留两位;%.2e表示以指数形式表示小数,小数部分保留两位. 001是因为十进制转二进制精度问题 阅读全文
posted @ 2019-10-31 19:38 姚蔚奇 阅读(153) 评论(3) 推荐(0)
摘要: Part1 1.分号和逗号的位置,容易遗漏或者多加。 2.一些地方的空格要注意。 3.字母的拼写错误。 Part2 实验总结与体会 通过这次试验,我更好地了解c语言。本次实验对于操作还是不太熟悉,语法也经常出错。对于一些结构也不是很清楚,编程的思路也有所欠缺。 阅读全文
posted @ 2019-10-20 17:01 姚蔚奇 阅读(130) 评论(0) 推荐(0)