diff options
author | Oskar <[email protected]> | 2024-08-11 20:59:53 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-11 20:59:53 +0200 |
commit | 06615448f1fd8378817e8ef72b5347ae3f0c3577 (patch) | |
tree | fc89a7edaee13953211d006a9c1a428dd279247c /3p33.cpp | |
parent | b45c0d29ee690c8b436a33581d3b108e6064b5a7 (diff) |
more
Diffstat (limited to '3p33.cpp')
-rw-r--r-- | 3p33.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/3p33.cpp b/3p33.cpp new file mode 100644 index 0000000..96d0105 --- /dev/null +++ b/3p33.cpp @@ -0,0 +1,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; +} |