Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string a;
- int b[27];
- ///////////////////////////////////////////////////////
- int main() //
- {
- cin >> a;
- for(int i = 0; i < a.size(); i++)
- {
- if(a[i] == 'a') b[0] ++ ;
- if(a[i] == 'b') b[1] ++ ;
- if(a[i] == 'c') b[2] ++ ;
- if(a[i] == 'd') b[3] ++ ;
- if(a[i] == 'e') b[4] ++ ;
- if(a[i] == 'f') b[5] ++ ;
- if(a[i] == 'g') b[6] ++ ;
- if(a[i] == 'h') b[7] ++ ;
- if(a[i] == 'i') b[8] ++ ;
- if(a[i] == 'j') b[9] ++ ;
- if(a[i] == 'k') b[10] ++ ;
- if(a[i] == 'l') b[11] ++ ;
- if(a[i] == 'm') b[12] ++ ;
- if(a[i] == 'n') b[13] ++ ;
- if(a[i] == 'o') b[14] ++ ;
- if(a[i] == 'p') b[15] ++ ;
- if(a[i] == 'q') b[16] ++ ;
- if(a[i] == 'r') b[17] ++ ;
- if(a[i] == 's') b[18] ++ ;
- if(a[i] == 't') b[19] ++ ;
- if(a[i] == 'u') b[20] ++ ;
- if(a[i] == 'v') b[21] ++ ;
- if(a[i] == 'w') b[22] ++ ;
- if(a[i] == 'x') b[23] ++ ;
- if(a[i] == 'y') b[24] ++ ;
- if(a[i] == 'z') b[25] ++ ;
- }
- for(int i = 0; i < 26; i++) cout << b[i] << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement