#include <iostream>
#include<string>
#include <vector>
using namespace std;
class CNum{
public:
CNum(){
pi_num = new int();
*pi_num=11;
}
CNum(CNum &other){
pi_num = new int(*other.pi_num);
}
~CNum(){
if(pi_num!=NULL) delete pi_num;
}
int iGetVal(){
return *pi_num;
}
CNum operator + (CNum &other){
CNum result;
*result.pi_num=*pi_num+*other.pi_num;
return result;
}
void operator = (int val){
*pi_num=val;
}
private:
int *pi_num;
};
int main() {
CNum c_t0, c_t1, c_t2;
cout<<c_t2.iGetVal();
c_t0=2;
c_t1=3;
CNum csum;
c_t0+c_t1;
csum = c_t0 + c_t1;
cout<<c_t0.iGetVal();
cout<<csum.iGetVal();
}
#include <iostream>
#include<string>
using namespace std;
class CTab{
public:
CTab(){
pi_tab=new int();
size=0;
}
~CTab(){if(pi_tab!=NULL) delete pi_tab;}
void vSetSize(int iSize){
delete pi_tab;
size=iSize;
pi_tab=new int[iSize];
}
CTab(const CTab &COther){
size=COther.size;
pi_tab=new int[size];
for (int i=0; i<size; i++){
pi_tab[i]=COther.pi_tab[i];
}
}
CTab operator+(CTab &other) {
int newSize = size + other.size;
CTab CRes;
CRes.vSetSize(newSize);
int i = 0;
for (i; i < size; i++) {
CRes.pi_tab[i] = pi_tab[i];
}
for (int j = 0; j < other.size; j++) {
CRes.pi_tab[i] = other.pi_tab[j];
i++;
}
return (CRes);
}
void operator=(const CTab &other){
if (pi_tab!=NULL) delete pi_tab;
size=other.size;
pi_tab=new int[other.size];
for (int i=0; i<other.size; i++){
pi_tab[i]=other.pi_tab[i];
}
}
int *pi_tab;
int size;
};
int main() {
CTab ct0, ct1;
ct0.vSetSize(2);
ct1.vSetSize(1);
ct0.pi_tab[0]=0;
ct0.pi_tab[1]=1;
ct1.pi_tab[0]=4;
CTab csum;
csum=ct0+ct1;
for (int i=0; i<3; i++){
cout<<csum.pi_tab[i]<<" ";
}
}
#include <iostream>
#include<string>
#include <vector>
using namespace std;
class CNode{
public:
CNode(int val){
pi_val=new int(val);
}
CNode(CNode &other){
pi_val=new int(*other.pi_val);
for(int i=0; i<other.v_kids.size(); i++){
v_kids.push_back(other.v_kids[i]);
}
}
~CNode(){
delete pi_val;
for(int i=0; i<v_kids.size(); i++){
if(v_kids[i]!=NULL) delete v_kids[i];
}
}
void vSetVal(int iVal){
*pi_val=iVal;
}
void vAdd(CNode *pcKid){
v_kids.push_back(pcKid);
}
void vPrint(){
cout<<*pi_val<<" ";
for(int i=0; i<v_kids.size(); i++){
v_kids[i]->vPrint();
}
}
private:
int *pi_val;
vector<CNode*> v_kids;
};
class CTree{
public:
CTree(){
pc_root=new CNode(0);
}
CTree(CTree &other){
pc_root=new CNode(*other.pc_root);
}
~CTree(){
delete pc_root;
}
CNode *pcGetRt(){
return pc_root;
}
void vPrint(){
pc_root->vPrint();
}
private:
CNode *pc_root;
};
int main() {
CTree c_t0;
c_t0.pcGetRt()->vSetVal(1);
c_t0.pcGetRt()->vAdd(new CNode(2));
CNode *pc_buf;
pc_buf = new CNode(3);
pc_buf->vAdd(new CNode(4));
c_t0.pcGetRt()->vAdd(pc_buf);
c_t0.vPrint();
CTree *pc_copy = new CTree(c_t0);
pc_copy->vPrint();
delete pc_copy;
}*/
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}