在牛客在线编程测试中,有人的代码可以直接动态创建string数组
#include <iostream>
using namespace std;
......
cin>>n;
string str[n];
然而我的VS并不能通过这样的编码方式,为什么他这样可以呢?
在牛客在线编程测试中,有人的代码可以直接动态创建string数组
#include <iostream>
using namespace std;
......
cin>>n;
string str[n];
然而我的VS并不能通过这样的编码方式,为什么他这样可以呢?
#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
string* str = new string[n];
delete []str;
system("pause");
}
你看这样是否满足你的要求