2019年10月22日

C++中的引用

摘要: ```c++ include include include using namespace std; int main() { int a = 2, b; //变量 int &r = a; //引用 int p1 = &a; int p2 = &r; //int &r = b; //错误,不可更改 阅读全文

posted @ 2019-10-22 10:05 星辰之衍 阅读(189) 评论(0) 推荐(0) 编辑

C++引用与传参

摘要: ```c++ include using namespace std; void Swap(int pa, int pb) { int t = pa; pa = pb; pb = t; cout 阅读全文

posted @ 2019-10-22 10:05 星辰之衍 阅读(195) 评论(0) 推荐(0) 编辑

C++中cout输出字符串和字符串型指针地址值的方法以及C语言中的printf用法比较

摘要: ```c++ include using namespace std; include int main() { char pstr = "china"; char qstr = "america"; char q = "adf"; char s; s = "hello"; printf("pstr 阅读全文

posted @ 2019-10-22 10:04 星辰之衍 阅读(1430) 评论(0) 推荐(0) 编辑

Python的复制,浅拷贝和深拷贝

摘要: https://www.cnblogs.com/xueli/p/4952063.html 如果给一个变量赋值一个对象,那么新变量和原对象变量将会是同一个引用,其中一方改变,另一方也会改变。 该问题可以用浅拷贝来解决。但是浅拷贝只能解决对象的第一层的引用问题(或数组的第一维),如果接下去的属性还是对象 阅读全文

posted @ 2019-10-22 10:03 星辰之衍 阅读(199) 评论(0) 推荐(0) 编辑

Python中的self用法之面向对象

摘要: 输出: 参考:https://blog.csdn.net/zxyhhjs2017/article/details/80218435 阅读全文

posted @ 2019-10-22 10:02 星辰之衍 阅读(683) 评论(0) 推荐(0) 编辑

Design a stack that supports getMin() in O(1) time and O(1) extra space

摘要: Question: Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operat 阅读全文

posted @ 2019-10-22 10:01 星辰之衍 阅读(167) 评论(0) 推荐(0) 编辑

Python的sys.argv用法

摘要: ```py import sys a = sys.argv[:] print("输入的参数为:", a) def train_start(start_time, end_time, select_equipment): print('start_time = ', start_time) print("end_time = ", end_time) print('select_time = ', 阅读全文

posted @ 2019-10-22 09:59 星辰之衍 阅读(294) 评论(0) 推荐(0) 编辑

导航