摘要: 4w3:第四周程序填空题1 描述 下面程序的输出是: 3+4i 5+6i 请补足Complex类的成员函数。不能加成员变量。 输入无输出3+4i5+6i样例输入 样例输出 Approach: 4w4:第四周程序填空题2 描述 下面的MyInt类只有一个成员变量。MyInt类内部的部分代码被隐藏了。假 阅读全文
posted @ 2018-12-23 22:24 Veritas_des_Liberty 阅读(897) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; class CDemo { private: int n; public: CDemo(int i = 0):n(i){} CDemo& operator++(); CDemo operator++(int); operator int() { return n; } friend ... 阅读全文
posted @ 2018-12-23 22:02 Veritas_des_Liberty 阅读(280) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; class Complex { public: double real, imag; public: Complex(double r = 0, double i = 0): real(r), imag(i){}; friend ostream& operator>(... 阅读全文
posted @ 2018-12-23 21:40 Veritas_des_Liberty 阅读(682) 评论(0) 推荐(0) 编辑
摘要: Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.) Your car drives automatically accord 阅读全文
posted @ 2018-12-23 18:57 Veritas_des_Liberty 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 961. N-Repeated Element in Size 2N Array In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times 阅读全文
posted @ 2018-12-23 12:57 Veritas_des_Liberty 阅读(246) 评论(0) 推荐(0) 编辑