Website Summary Files Commits Branches @commit @diff @stats
path: root / Week05 / Exercise13.cpp
blob: cc43afe5dd118882be71983ce39cd3e928c7c5ef (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
#include <iostream>

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

    int numbers[SIZE];
    for (unsigned int i = 0; i < SIZE; i++) {
        std::cin >> numbers[i];
    }

    int search;
    std::cin >> search;

    unsigned int occurrences = 0;
    for (unsigned int i = 0; i < SIZE; i++) {
        if (numbers[i] == search)
            occurrences++;
    }

    std::cout << occurrences << std::endl;

    return 0;
}