You are viewing a single comment's thread. Return to all comments →
i'd love your way and it's passed on hackarank but i tested it on visual studio, the input of N is a loop without break. i have modified a little to:
int main() { int N, i = 0; std::cin >> N; int* A = new int[N]; while (i> A[i++]); while (std::cout << A[--N] << ' ' && N); delete[] A; return 0; }
Arrays Introduction
You are viewing a single comment's thread. Return to all comments →
i'd love your way and it's passed on hackarank but i tested it on visual studio, the input of N is a loop without break. i have modified a little to:
include
int main() { int N, i = 0; std::cin >> N; int* A = new int[N]; while (i> A[i++]); while (std::cout << A[--N] << ' ' && N); delete[] A; return 0; }