-
讨论 (0)
这个用户还没有发布过讨论 -
贡献 (0)
啊哦,这个用户还没贡献过题目和题解~ -
递交 (0)
最近递交
状态 题目 递交者 时间 内存 语言 递交时间 * wuyiming2026 5ms 532.0 KiB C++ 2026-12-05 14:06:27 * wuyiming2026 6ms 532.0 KiB C++ 2026-12-05 14:05:48 * wuyiming2026 517ms 2.242 MiB C++ 2026-12-05 14:04:59 * wuyiming2026 7ms 540.0 KiB C++ 2026-11-21 17:14:57 * wuyiming2026 20ms 532.0 KiB C++ 2026-11-20 22:14:21 P3052 凯撒密码 GESP202603 三级T2 wuyiming2026 19ms 536.0 KiB C++ 2026-11-20 22:09:44 P3052 凯撒密码 GESP202603 三级T2 wuyiming2026 18ms 528.0 KiB C++ 2026-11-20 22:08:46 P3052 凯撒密码 GESP202603 三级T2 wuyiming2026 18ms 512.0 KiB C++ 2026-11-20 22:04:11 P3052 凯撒密码 GESP202603 三级T2 wuyiming2026 19ms 540.0 KiB C++ 2026-11-20 22:02:02 * wuyiming2026 22ms 532.0 KiB C++ 2026-11-20 21:25:38
个人简介
- 1. > asdfgfhhjklk
//asdfgfhhjklk
asdfgfhhjklk
cpp
#include<bits/stdc++.h>
using namespace std;
string s="chinese";
int main()
{
s+="123";//拼接+
cout<<s<<endl;
for(int i=0;i<=s.length();i++)cout<<s[i];//遍历 length=sise
cout<<endl;
cout<<s<<endl;//整体输出
s.erase(6,3);//删除 s.erase(x,y) 从第x位置开始删除y个字符
cout<<s<<endl;//结果:chines3
s="chinese";
s.erase(3) ;//删除 s.erase(x,y) 从第x位置开始全部删除
cout<<s<<endl;//结果:chi
s="chinese";
s=s.substr(3,2);//取子串 s.substr(x,y)从x位置开始取y个字符
cout<<s<<endl;//结果:ne
s="chinese";
s=s.substr(3);//取子串 s.substr(x)从x位置开始取到结束
cout<<s<<endl;//结果:nese
return 0;
}