summaryrefslogtreecommitdiff
path: root/3p25.cpp
blob: 44f33dedf9ee6a0877f67e46f8858a96fbae3ea4 (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
#include <iostream>
#include <vector>
#include "sales_data.hpp"
#include "sales_item.hpp"

/*
 *
 * 3.25
 *
 * Just a note to myself, i first finished this
 * exercise by making a begin variable and also a temporary
 * variable and incrementing on the temporary one, but
 * of course you can just do everything directly which
 * created this ugly thing ++*(scores.begin() + grade / 10);
 * A bit difficult to read, and i do wonder if its faster
 * 
 */

using std::string;
using std::cout;
using std::cin;
using std::cerr;
using std::clog;
using std::endl;
using std::vector;
int main () {

	vector<unsigned> scores(11, 0);
	unsigned grade;
	while (cin >> grade) {
		if (grade <= 100) {
			++*(scores.begin() + grade / 10);
		}
	}

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

	cout << endl;
	return 0;
}