首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴gougoudan的代码贴C++
#include <iostream>
using namespace std;

struct HuffNode
{
    float weight;
    int parent;
    int lchild;
    int rchild;
};

//实现哈夫曼编码, 返回根节点
......................
阅读全部 | 2020年6月6日 22:34
#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)
{
......................
阅读全部 | 2020年6月6日 19:43
#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)
{
......................
阅读全部 | 2020年6月6日 19:41
#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
......................
阅读全部 | 2020年6月3日 14:48
#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(){
......................
阅读全部 | 2020年6月1日 20:01
#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;; }
......................
阅读全部 | 2020年6月1日 19:48
#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:
......................
阅读全部 | 2020年5月20日 16:13
#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:
......................
阅读全部 | 2020年5月20日 15:47
#include<iostream>
#include<iomanip>
#include<string>
#include<stdlib.h>

using namespace std;
struct student
{
    char xuehao[10];//学号
    char name[10];//姓名
    char sex[5];//性别
    char jiguan[10];//籍贯
......................
阅读全部 | 2020年5月17日 13:39
上一页 1 2 3 4
gougoudan