
2021c++
爽爽子秃头小生活
小菜鸡一个刚刚接触编程,哪里不对请大佬指出
展开
-
线性表(吼吼)
线性表 顺序表 #include<bits/stdc++.h> using namespace std; #define MaxS 100 typedef int Elem; typedef struct { Elem date[MaxS]; int length; }Sqlist; void printlist(Sqlist &q) { for(int i = 0; i < q.length; i++) { cout<原创 2021-12-12 20:32:25 · 473 阅读 · 0 评论 -
c++的各种名词大集合以及注意事项
阿巴阿巴 呱呱呱原创 2021-05-17 16:54:39 · 571 阅读 · 0 评论 -
类
类 类的初始化 析构函数,构造函数(先后顺序) 友元类 类的初始化 #include<bits/stdc++.h> using namespace std; class Time { public: void setx(int x)//赋值 { m_x = x; } int getx()//提取 { return m_x; } private: int m_x; }; int main() {原创 2021-05-05 20:37:41 · 138 阅读 · 0 评论 -
substr,setw说明
substr(a,b) 意思是从第几个字母开始到底几个 #include<bits/stdc++.h> using namespace std; int main() { string a = "abcd123"; string b = a.substr(2,2); cout<<b; } 答案是cd setw是保留多少的空格 setw(8)之间保留7个空格 ...原创 2021-03-18 16:41:59 · 147 阅读 · 0 评论