#include<iostream>
#include<cstring>
#include<sstream>
using namespace std;
string a = "hello ";
string b = "world!";
string f1(){
return a + b;
}
string f2(){
string c;
c.append(a + b);
return c;
}
string f3(){
stringstream ss;
ss<<a<<b;
return ss.str();
}
int main(){
cout << f1() <<endl;
cout << f2() << endl;
cout << f3() << endl;
return 0;
}
运行结果
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)