1#include <iostream> // cout
2#include <iomanip> // setw
3int main()
4{
5 int array[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
6 for (auto n : array)
7 {
8 std::cout << std::setw(4) << n;
9 }
10}
11
1const int n = 10;
2int array[n] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
3for (int i=0;i<n;i++)
4 printf("%4d",array[i]);
5