[ create a new paste ] login | about

Link: http://codepad.org/sfYrp2Xv    [ raw code | output | fork ]

C++, pasted on Oct 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

int main() {
    int a[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
    int b[20];

    for (int i = 9; i >= 0; --i)
        b[9 - i] = a[i];

    for (int i = 0; i < 10; ++i)
        std::cout << b[i] << std::endl;  

    return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9


Create a new paste based on this one


Comments: