Advertisement
llirik

Untitled

Oct 26th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a[10] = {0,0,0,0,0,0,0,0,0,0}, i = 0;
  7.     string s;
  8.     cin >> s;
  9.  
  10.     while (s[i] != '.') {
  11.         a[int(s[i])-48]++;
  12.         i++;
  13.     }
  14.  
  15.     for (int m = 1; m <= 10; m++) {
  16.         for (int j = 0; j < 10; j++) {
  17.             if (a[j] == m) cout << j;
  18.         }
  19.     }
  20.  
  21.     cout << endl;
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement