10 2020 档案

摘要:第一种: 1 #include <iostream> 2 #include <unordered_set> 3 #include <utility> 4 #include <vector> 5 6 using namespace std; 7 8 using KEY = pair<int,int>; 阅读全文
posted @ 2020-10-21 10:20 黎曼猜想 阅读(1430) 评论(0) 推荐(1)
摘要:inline:声明和定义处(类外)都可以写,建议只写在类外定义处,实现写在inl.h里include在.h文件里而不是写在.cpp或.cc; const:类内声明和类外定义都要写; virtual:只能写在类内声明处; override/final:只能写在类内声明处; explicit:只能写在类 阅读全文
posted @ 2020-10-20 11:27 黎曼猜想 阅读(229) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include <stdexcept> 3 4 using namespace std; 5 6 7 class Data 8 { 9 public: 10 Data(int a,int b):y(a),m(b) 11 { 12 if(b < 1 | 阅读全文
posted @ 2020-10-12 21:18 黎曼猜想 阅读(145) 评论(0) 推荐(0)
摘要:1 #include <stdio.h> 2 3 int main() 4 { 5 const int max_name = 20; // 字符数组最大长度 6 char name[max_name]; 7 8 char fmt[10]; 9 sprintf(fmt,"%%%ds",max_name 阅读全文
posted @ 2020-10-09 20:59 黎曼猜想 阅读(329) 评论(0) 推荐(0)
摘要:使用 max 比较多个数字(在c++20生效): 1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 int a = 0,b = 9,c = 9,d = 7; 8 cout << max( {a,b,c,d} ) < 阅读全文
posted @ 2020-10-02 21:39 黎曼猜想 阅读(1146) 评论(0) 推荐(0)