//在C++中利用string数据类型来直接定义一个字符串变量,可以通过+=的方式对字符串进行拼接;
//注意需要包含头文件 #include<string>
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main()
{
string nameSeed = "ABCDE";
string s;
for(int i = 0; i < 5; i++)
{
s = "Student_";
s += nameSeed[i];
cout << s << endl;
}
system("pause");
return 0;
}
//结果为:
// Student_A
// Student_B
// Student_C
// Student_D
// Student_E