您的位置:首页 > 其它

string类应用举例

2016-05-19 21:37 183 查看
* Copyright (c) 2016,烟台大学计算机与控制工程学院
* All rights reserved.
* 文件名:text.cpp
* 作者:常轩
* 微信公众号:Worldhello
* 完成日期:2016年5月19日
* 版本号:V1.0
* 问题描述:string类应用举例
* 程序输入:无
* 程序输出:见运行结果
*/
//string类应用举例
#include <iostream>
#include <string>
using namespace std;
inline void test(const char*title,bool value){
cout<<title<<"returns"<<(value?"true":"false")<<endl;
}
int main()
{
for(int i=0;i<2;i++)
{
string city,state;
getline(cin,city,',');
getline(cin,state);
cout<<"city:"<<city<<"    state:"<<state<<endl;
}
return 0;
}


运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: