Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise05_QuestionSolution.cpp
blob: 3714aebc171accce9de803707131fdccec5d2cda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>

/* Отговорът е не, не са нужни масиви. */

int main() {
    const unsigned int SIZE = 18;

    unsigned int zero_count = 0;
    int number;

    for (int i = 0; i < SIZE; i++) {
        std::cin >> number;

        if (number == 0)
            zero_count++;
        else
            std::cout << number << ' ';
    }

    for (int i = 0; i < zero_count; i++) {
        std::cout << 0 << ' ';
    }

    return 0;
}