summaryrefslogtreecommitdiff
path: root/vector-index-example.cpp
blob: f6a0e4374f9d73a2194f7cdc423197b8a6621d7f (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
#include <iostream>
#include <vector>
#include "sales_data.hpp"
#include "sales_item.hpp"

/*
 *
 * Description
 *
 *
 */

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); // 11 buckets, all initially 0
	unsigned grade;
	while (cin >> grade) {
		if (grade <= 100) {
			++scores[grade/10]; 
			// scores[grade/10] += 1; // basically equivalent
		}
	}
	
	return 0;
}