Arrays Introduction

  • + 3 comments

    Hi, I had not think it, but can be done like this:

    #include <iostream>
    int main() {
        int N;
        std::cin>>N;
        int *A = new int[N];
        while(std::cin>>A[--N]);
        while(A[++N] && std::cout<<A[N]<<' ');
        delete[] A;
        return 0;
    }