Advertisement
ZhilinskiyG

Tusk 5_11

Mar 26th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int mas[11];
  7.     int i = 0;
  8.     int sum=0;
  9.     while (i < 11){
  10.         mas[i] = 0;
  11.         i++;
  12.        
  13.     }
  14.     int a;
  15.     cin >> a;
  16.     while (a != -1){
  17.         mas[a]++;
  18.         cin >> a;
  19.         sum++;
  20.     }
  21.     i = 0;
  22.     while (i < 11){
  23.         cout << i << " - " << mas[i]*100/sum<<"%"<< endl;
  24.         i++;
  25.     }
  26.  
  27.     return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement