很简单的一个小代码,用了for循环和范围for
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
int a[10] = {};
for (int i = 0; i < 10; i++)
a[i] = i;
for (auto c : a)
cout << c << " ";
cout << endl;
system("pause");
return 0;
}