python && c++类模板

class Solution():
    def __init__(self, x):
        self.params = x
    
    def func(self):
        print(self.params)

 

c++

class Solution{
public:
    Solution(int i){
        cout << i << endl;
    }
    bool printss(){
        return true;
    }
};

int main() {
    Solution s(10);
    cout << s.printss();
    return 0;
}
    
     

 

posted @ 2020-09-10 09:54  威威后花园  阅读(255)  评论(0编辑  收藏  举报