-
Notifications
You must be signed in to change notification settings - Fork 0
/
integer_count.cpp
57 lines (49 loc) · 919 Bytes
/
integer_count.cpp
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
int main(int argc, char const *argv[])
{
int k;
std::cin >> k;
std::vector<int> numbers;
int input;
for (int i = 0; i < k; i++)
{
std::cin >> input;
numbers.push_back(input);
}
int one = 0;
int five = 0;
int ten = 0;
for (auto number : numbers)
{
if (number == 1)
{
one++;
}
else
{
if (number == 5)
{
five++;
}
else
{
if (number == 10)
{
ten++;
}
else
{
/* do nothing */
}
}
}
}
cout << one << endl;
cout << five << endl;
cout << ten << endl;
return 0;
}