コード例 #1
0
ファイル: Q4.cpp プロジェクト: Manasseh-Zhou/StudyOnCoursera
// end
int main(int argc, char* argv[]) {
    CType obj;
    int n;
    cin >> n;
    while (n) {
        obj.setvalue(n);
        cout << obj++ << " " << obj << endl;
        cin >> n;
    }
    return 0;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: Hongyan0627/PKU_Cplusplus
CType& CType::operator++(int){
        CType* temp = new CType();
        temp->setvalue(num);
        num = num * num;
        return *temp;
}