int main()
{
string str;
cin >> str; //获取输入
vector<string> svec(str.length());
for (unsigned int i = 0; i < str.length(); i++) //保存在vector中
{
svec[i] = str[i];
}
string *pstr = new string[str.length()]; //动态创建数组
for (unsigned int i = 0; i < str.length(); i++) //复制给新数组
{
*(pstr+i) = svec[i];
cout << *(pstr+i);
}
delete []pstr; //释放内存
return 0;
}
{
string str;
cin >> str; //获取输入
vector<string> svec(str.length());
for (unsigned int i = 0; i < str.length(); i++) //保存在vector中
{
svec[i] = str[i];
}
string *pstr = new string[str.length()]; //动态创建数组
for (unsigned int i = 0; i < str.length(); i++) //复制给新数组
{
*(pstr+i) = svec[i];
cout << *(pstr+i);
}
delete []pstr; //释放内存
return 0;
}