上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 54 下一页
摘要: 源程序: // 32 66 90//15,32,9,22,18 43,66,49,35,53 90,78,71,86 //分析:分块查找由索引查找和子表查找两步完成。设n个数据元素的查找表分为m个子表,且每个子表//均为t个元素,则t=n/m 。这样,分块查找的平均查找长度为:// ASL=ASL索 阅读全文
posted @ 2019-11-21 11:04 bobo哥 阅读(411) 评论(0) 推荐(0)
摘要: 源程序: //二分查找法#include <stdio.h>#define MaxSize 8typedef struct{ int stuno; char stuname[20];}TableElem; TableElem stu[]={{1001,"zhang"},{1009,"wang"},{ 阅读全文
posted @ 2019-11-21 10:31 bobo哥 阅读(299) 评论(0) 推荐(0)
摘要: 源程序: #include <stdio.h>#define MaxSize 8typedef struct{ int stuno; char stuname[20];}TableElem; TableElem stu[]={{1001,"zhang"},{1009,"wang"},{2005,"s 阅读全文
posted @ 2019-11-21 09:15 bobo哥 阅读(790) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream> #include <fstream> //包含文件操作的头文件 using namespace std; void main() { ifstream txt1("c:\\TEST.txt"); //建立输入文件对象指针txt1,指向文件"TEST. 阅读全文
posted @ 2019-11-20 20:18 bobo哥 阅读(319) 评论(0) 推荐(0)
摘要: 源程序: #include < iostream > #include < fstream > #include < cmath > #include < vector > #include < iomanip > #include < string > using namespace std; c 阅读全文
posted @ 2019-11-20 20:04 bobo哥 阅读(2424) 评论(0) 推荐(0)
摘要: 源程序: #include < iostream> #include < fstream > using namespace std; void main() { char *p = "C++程序设计" ; ofstream myFile("c:\\C++_9_5_2.txt"); //在工程文件的 阅读全文
posted @ 2019-11-20 19:34 bobo哥 阅读(259) 评论(0) 推荐(0)
摘要: 源程序: #include < iostream > #include < string > #include <iomanip> using namespace std; class Student //定义学生类 { private: string name; //学生姓名 float scor 阅读全文
posted @ 2019-11-20 19:25 bobo哥 阅读(412) 评论(0) 推荐(0)
摘要: 源程序: //直角三角形在派生矩形类,矩形类的参数也由键盘输入。设计这些类并测试他们的功能。 #include < iostream > #include < cmath > using namespace std; class Line//线段基类 { protected: double size 阅读全文
posted @ 2019-11-19 16:21 bobo哥 阅读(455) 评论(0) 推荐(0)
摘要: 源程序: //4.基类是使用极坐标的点类,从它派生一个圆类,圆类用点类的左边作圆心,圆周通过极坐 //标原点,圆类有输出圆心直、圆半径和面积的成员函数。完成类的设计并验证之。 #include < iostream > #include < cmath > using namespace std; 阅读全文
posted @ 2019-11-19 16:13 bobo哥 阅读(674) 评论(0) 推荐(0)
摘要: 矩形类用线段对象的两个坐标作为自己一条边的位置,它具有另外一个边长,能输出矩形的4个点坐标。给出类的定义并用程序验证它们的功能; #include < iostream > #include < cmath > using namespace std; class Point//点类 { prote 阅读全文
posted @ 2019-11-19 15:54 bobo哥 阅读(663) 评论(0) 推荐(0)
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 54 下一页