Advertisement
rengetsu

Timus_1263

Jul 20th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. //Timus 1263
  2. #include <iomanip>
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7.     double n, m, nn[10001], ch=0, answ;
  8.     cin >> n >> m;
  9.     for(int i=0;i<m;i++)
  10.     {
  11.         cin >> nn[i];
  12.     }
  13.     for(int i=1;i<n+1;i++)
  14.     {
  15.         for(int y=0;y<m;y++)
  16.         {
  17.             if(nn[y]==i)
  18.             {
  19.                 ch++;
  20.             }
  21.         }
  22.         answ = (100/m)*ch;
  23.         cout << fixed << setprecision(2) << answ << "%" << endl;
  24.         ch = 0;
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement