10 2021 档案

摘要:1、cerr freopen cout输出到文件内时,cerr能输出到控制台显示 2、cin.getline() defalut -> '\n' #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); #include<bits 阅读全文
posted @ 2021-10-23 10:25 wanghai673 阅读(28) 评论(0) 推荐(0) 编辑
摘要:1、this指针的运用 指向当前函数作用类的指针 相当于翻译为C语言,r.run() = run(test * this) #include<bits/stdc++.h> using namespace std; class test{ private: double real,imag; publ 阅读全文
posted @ 2021-10-20 17:19 wanghai673 阅读(39) 评论(0) 推荐(0) 编辑
摘要:1、 成员函数可写在类的外面 #include<bits/stdc++.h> using namespace std; class student{ public: int grade; string name; void init_(string _name,int _grade){ name = 阅读全文
posted @ 2021-10-07 12:51 wanghai673 阅读(36) 评论(0) 推荐(0) 编辑
摘要:1、引用 #include<bits/stdc++.h> using namespace std; void swap(int &a,int &b){ int temp = a; a = b; b = temp; } void swap(int *a,int *b){ int temp = *a; 阅读全文
posted @ 2021-10-05 11:26 wanghai673 阅读(28) 评论(0) 推荐(0) 编辑
摘要:1、vector sort 的降序 vector<int> v; // 其sort降序 bool cmp(int a,int b){ return a>b; } sort(v.begin(),v.end(),cmp); //去重 sort(vt.begin(),vt.end()); vt.erase 阅读全文
posted @ 2021-10-04 22:04 wanghai673 阅读(36) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示