(Print an array) Write a recursive function printArray that takes an array, a starting subscript and an ending subscript as arguments, returns nothing and prints the array. The function should stop processing and return when the starting subscript equals the ending subscript.
The input consists of 30 numbers (range from 1 to 1000)
输入
11 11 12 12 13 13 14 14 15 15 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
输出
11 11 12 12 13 13 14 14 15 15 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
The main function is provided, you only need to complete the Function printArray:
#include <iostream>
#include <array>
using namespace std;
const int SIZE = 30;
void printArray( array< int, SIZE> &, size_t, size_t );
int main()
{
array< int, SIZE > values = {};
unsigned int i = 0;
while( i < SIZE ){
int value = 0;
cin>> value;
values[i++]=value;
}
printArray( values, 0, SIZE - 1 );
cout << endl;
} // end main