Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- vector <int> data;
- int below=0, above=0, index, n;
- int interval[10] = {0};
- double mean = 0;
- while(cin >> n){
- data.push_back(n);
- interval[n/10 == 10 ? 9 : n/10]++;
- mean+=n;
- }
- sort(data.begin(), data.end());
- mean/=data.size();
- for(index=0;index<data.size();index++){
- if(data[index]<mean){
- below++;
- }
- if(data[index]>mean){
- above++;
- }
- }
- cout << "**** Score Report ****" << endl << endl;
- cout << "Mean: " << fixed << setprecision(2) << mean << endl;
- cout << "Above Mean: " << above << endl;
- cout << "Below Mean: " << below << endl << endl;
- for(int i=0;i<10;i++){
- cout << i*10 << " ~ " << i*10+9+(i==9) << ": ";
- for(int j=interval[i];j>0;j--){
- cout << "*";
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement