字符串拼接
来源:互联网 发布:java 就业特招班 编辑:程序博客网 时间:2024/04/25 08:51
#include<iostream>#include<string>using namespace std;int main(){char cont = 'y';string s, result;cout << "请输入第一个字符串:" << endl;while (cin>>s){if (!result.size()){result += s;}else{result = result + " " + s;}cout << "是否继续,y or Y !" << endl;cin >> cont;if (cont == 'y' || cont == 'Y'){cout << "请输入下一个字符串:" << endl;}elsebreak;}cout << "拼接好的字符串:" << result << endl;return 0;}
阅读全文
0 0
- 拼接字符串:
- 字符串拼接
- 字符串拼接
- 字符串拼接
- 字符串拼接
- 拼接字符串
- 拼接字符串
- 拼接字符串
- 拼接字符串
- 字符串拼接
- 拼接字符串
- 字符串拼接
- 字符串拼接
- 拼接字符串
- 字符串拼接
- 字符串拼接
- 字符串拼接
- 字符串拼接
- Volley源码分析(二)
- MySQL的优化
- hdu6170 Two strings【regex真好用】
- 1881: wjw的树
- centos学习批注(1)
- 字符串拼接
- 8月22日小结
- java提高篇(四)-----java的四舍五入
- 手机清理缓存文件
- ESP8266 引脚复用功能选择
- Fix the problem:xxx is not in the sudoers file.This incident will be reported
- @MapKey与@MapKeyColumn二者区别
- Ubuntu 终端路径名太长
- Shell常用命令