#include <iostream>
#include <cstring>
using namespace std;
class Employee
{
public:
virtual void pay(){ } // 第一题 这一行不要
string name;
float salary;
};
......................
阅读全部
|
gougoudan
贴于 2020年6月8日 15:24
hide
bbsi
#include <iostream>
#include <sstream>
#include <cstring>
#include <cassert>
using namespace std;
template <typename Type, int Count>
class Array
{
enum { sz = Count };
Type i[Count];
......................
阅读全部
|
gougoudan
贴于 2020年6月8日 11:41
hide
bbsi
#include <iostream>
using namespace std;
struct HuffNode
{
float weight;
int parent;
int lchild;
int rchild;
};
//实现哈夫曼编码, 返回根节点
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 22:34
hide
bbsi
#include <iostream>
using namespace std;
struct HuffNode
{
float weight;
int parent;
int lchild;
int rchild;
};
//实现哈夫曼编码, 返回根节点
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 22:34
hide
bbsi
#include <iostream>
#include <algorithm>
using namespace std;
void showarray(int a[], int c, int d)
{
for (int i = 0; i < c; ++i)
cout << a[i] << ' ';
cout << endl;
}
//对a[low]到a[high]由小到大排序
bool QuickSort(int a[], int count, int teamIdx)
{
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 19:43
hide
bbsi
#include <iostream>
#include <algorithm>
using namespace std;
void showarray(int a[], int c, int d)
{
for (int i = 0; i < c; ++i)
cout << a[i] << ' ';
cout << endl;
}
//对a[low]到a[high]由小到大排序
bool QuickSort(int a[], int count, int teamIdx)
{
......................
阅读全部
|
gougoudan
贴于 2020年6月6日 19:41
hide
bbsi
#include <iostream>
#include <iomanip>
#include <cstring> // strcpy and strcat prototypes
#include <cstdlib> // exit prototype
using namespace std;
class String
{
friend ostream &operator<<(ostream &, const String &);
friend istream &operator>>(istream &, String &);
public:
String(const char * = ""); // conversion/default constructor
......................
阅读全部
|
gougoudan
贴于 2020年6月3日 14:48
hide
bbsi
#include <iostream>
using namespace std;
class Skill
{
int *nSkill;
public:
Skill(int n) {
nSkill = new int;
*nSkill = n;
cout << "member object " << (*nSkill) <<" constructed" << endl;
}
~Skill(){
......................
阅读全部
|
gougoudan
贴于 2020年6月1日 20:01
hide
bbsi
#include <iostream>
using namespace std;
class Point
{
private:
double x;
double y;
public:
Point(double ix, double iy) :x(ix), y(iy){ cout << "Point Object Constructed." << endl; }
virtual ~Point(){ cout << "Point Object Destructed." << endl; };
virtual void Show() { cout << "x=" << x << ",y=" << y << endl;; }
......................
阅读全部
|
gougoudan
贴于 2020年6月1日 19:48
hide
bbsi
#include <iostream>
using namespace std;
template <class T>
class DynamicVector
{
T* array; // pointer to the items 指向分配空间的指针
unsigned mallocSize; // number of allocated spaces 分配空间的大小
unsigned numofItems; // number of items 向量内已经存储的元素数量
int virtualZero; // virtual zero 数组起始下标,C语言中通常数组下标是从0开始, 这个数据属性可以让数组的下标从-10或2等等整数开始 ,让数组更加灵活。
public:
......................
阅读全部
|
gougoudan
贴于 2020年5月20日 16:13
hide
bbsi