题解 | #创建动态数组#
创建动态数组
http://www.nowcoder.com/practice/218b577112a24c23a41bdc01f28c18ac
#include using namespace std;
int main() {
int n;
cin >> n;
// write your code here......
int* my_sz = new int[n]();
for (int i = 0; i<n; i++)
{
my_sz[i] = n+i;
}
for (int i = 0; i<n; i++)
{
cout << my_sz[i] << " ";
}
delete[] my_sz;
return 0;
}