Advertisement
dllbridge

Untitled

Oct 22nd, 2022
890
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. string a;
  5. int  b[27];
  6.  
  7.  
  8.  
  9. ///////////////////////////////////////////////////////
  10. int main()                                          //
  11. {
  12.     cin >> a;
  13.  
  14.     for(int i = 0; i  < a.size(); i++)
  15.     {
  16.        if(a[i] == 'a') b[0] ++ ;
  17.        if(a[i] == 'b') b[1] ++ ;
  18.        if(a[i] == 'c') b[2] ++ ;
  19.        if(a[i] == 'd') b[3] ++ ;
  20.        if(a[i] == 'e') b[4] ++ ;
  21.        if(a[i] == 'f') b[5] ++ ;
  22.        if(a[i] == 'g') b[6] ++ ;
  23.        if(a[i] == 'h') b[7] ++ ;
  24.        if(a[i] == 'i') b[8] ++ ;
  25.        if(a[i] == 'j') b[9] ++ ;
  26.        if(a[i] == 'k') b[10] ++ ;
  27.        if(a[i] == 'l') b[11] ++ ;
  28.        if(a[i] == 'm') b[12] ++ ;
  29.        if(a[i] == 'n') b[13] ++ ;
  30.        if(a[i] == 'o') b[14] ++ ;
  31.        if(a[i] == 'p') b[15] ++ ;
  32.        if(a[i] == 'q') b[16] ++ ;
  33.        if(a[i] == 'r') b[17] ++ ;
  34.        if(a[i] == 's') b[18] ++ ;
  35.        if(a[i] == 't') b[19] ++ ;
  36.        if(a[i] == 'u') b[20] ++ ;
  37.        if(a[i] == 'v') b[21] ++ ;
  38.        if(a[i] == 'w') b[22] ++ ;
  39.        if(a[i] == 'x') b[23] ++ ;
  40.        if(a[i] == 'y') b[24] ++ ;
  41.        if(a[i] == 'z') b[25] ++ ;
  42.     }
  43.    
  44.    
  45.     for(int i = 0; i < 26; i++) cout << b[i] << ' ';
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement