C++ Primer 习题3.8
2012-09-29 15:54
162 查看
#include <string> #include <iostream> using std::cin; using std::cout; using std::endl; using std::string; using std::cerr; int main() { int states = 0; string result = ""; do{ cout<<"Make you choice!"<<endl<<"1 - input a string \n0 - end inputing strings "<<endl; cin>>states; if(states == 1){ cout<<"Input your string."<<endl; cin>>temp; result += temp; }else if(states != 0 && states != 1){ cerr<<"error choice!!"<<endl; } }while (states != 0); cout<<"The result of combing all the strings you input is "<<result<<endl; system("pause"); return 0; }
相关文章推荐
- C++ Primer第四版习题--3.8
- C++ primer 习题8-7 9 10
- C++ Primer 中文版 第4版 习题9.28
- c++ primer(第五版)学习笔记及习题答案代码版(第四章)表达式
- 《c++ Primer(第四版)》习题9.20
- C++ primer 习题练习:12.13
- 《C++ primer 4th》习题 7-31 记录
- C++ primer 课后习题
- C++ Primer 第1章 快速入门习题答案
- C++ Primer 第9章 习题9.30
- C++ Primer 第10章 习题10.24
- C++ primer习题笔记第4章
- C++ Primer 第11章 习题11.6
- C++ Primer 第11章 习题11.14
- C++ primer习题笔记第7~9章
- C++ Primer 第11章 习题11.29
- c++ primer 第五版第一章习题书店程序
- [C++学习] C++ Primer 第4版 习题4.18
- [C++ 学习] C++ Primer 习题 4.34 4.35
- C++ Primer 笔记+习题解答(七)