record.h
来自「这是本人精心搜集的关于常用图论算法的一套源码」· C头文件 代码 · 共 24 行
H
24 行
#include "Str.h"
class Record
{ friend bool operator==(const Record &x, const Record &y) {return x.key==y.key; }
friend bool operator<(const Record &x, const Record &y) { return x.key<y.key; }
friend bool operator>(const Record &x, const Record &y) { return x.key>y.key; }
friend bool operator>=(const Record &x, const Record &y) { return x.key>=y.key; }
friend bool operator<=(const Record &x, const Record &y) { return x.key<=y.key; }
friend bool operator!=(const Record &x, const Record &y) { return x.key!=y.key; }
friend istream &operator>>(istream&in,Record& x)
{ in>>x.key; return in; }
public:
Record():key(0){}
Record(String k):key(k){}
Record(const Record& copy)
{ key=copy.key; other=copy.other; }
Record& operator=(const Record& copy)
{ key=copy.key; other=copy.other; return *this; }
Record& operator=(const char *x){ key=x; }
String GetKey(){ return key; }
int length(){return strlen(key); }
private:
String key;
char *other;
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?