summaryrefslogtreecommitdiff
path: root/3p33.cpp
blob: 96d0105a589de190dc52e9303acac59f093894e1 (plain)
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
#include <iostream>
#include <vector>
#include "sales_data.hpp"
#include "sales_item.hpp"

/*
 *
 * 3.33
 *
 *
 */

using std::string;
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
using std::endl;
using std::vector;
int main () {
	/*
	  Because we assume all score clusters to start at a value of 0 when we increment,
	  we need to initialize them with 0 because if we did not then each array element
	  could have any value because it is uninitialized.

	  When we compile the program and run, we can see the uninitialized values get
	  printed.
	 */
	unsigned scores[11];
	unsigned grade;
	while (cin >> grade) {
		if (grade <= 100) {
			++scores[grade/10];
		}
	}

	for (auto i : scores) {
		cout << i << " ";
	}
	
	cout << endl;
	return 0;
}