题目描述

(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

操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解