酷代码 AI
菜单
服务商

C++实现酒店系统字符串指定位置字符替换

```cpp #include <iostream> #include <string> using namespace std; int main() { string s1; int pos; string s2; // 读取酒店系统字符串 cin >> s1; // 读取要替换的位置 cin >> pos; // 读取密钥字符串 cin >> s2; // 替换操作 s1.replace(pos, 1, s2); // 输出替换后的字符串 cout << s1 << endl; return 0; } ``` ######[AI问答 | 145点数解答 | 2026-05-16 19:14:42]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]