课评: 转出学生归档(王子墨/张立坤/黄俊博)+ 周四班级总结 + 新生章梓皓档案 + C++示例代码
This commit is contained in:
29
C++代码/学习/未命名3.cpp
Normal file
29
C++代码/学习/未命名3.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <bits/stdc++.h>
|
||||
#define endl '\n'
|
||||
using namespace std;
|
||||
|
||||
int n;
|
||||
int arr[100100];
|
||||
|
||||
int main(){
|
||||
// 替换
|
||||
string s = "abcdef";
|
||||
|
||||
// // 字符串.replace(pos, len, newstr);
|
||||
// cout << s.replace(1, 2, "ab cd");
|
||||
//
|
||||
//// s.size() // 如果是空 false
|
||||
//// s.empty() // 判断s是不是空的 true
|
||||
//
|
||||
// // 比较大小
|
||||
// string s1 = "123", s2 = "A";
|
||||
//
|
||||
// cout << (s1 < s2); // 0
|
||||
//
|
||||
s.erase(1, 2);
|
||||
|
||||
cout << s;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user