fork download
  1. #include<iostream>
  2. #include<string>
  3. #include<cstring>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. string a("Mewa wa mey twsam iepjoys gt mey ipbya.Pa xgn iph ayy, meysy wa hgmewhr gt whmysyam wh mey iepjoys.Agjy gt mey kpmys iepjoysa vwkk oy jgsy whmysyamwhr meph mewa ghy, hg cgly! Mey iguy nayu tgs mewa jyaapry wa p awjfky anoamwmnmwgh iwfeys wh vewie uwrwma epby oyyh aewtmyu ox 8 fkpiya.Mey fpaavgsu wa rwbyh oykgv, vwmegnm mey dngmya.");
  11.  
  12. int length = a.length();
  13. //cout<<length;
  14. int c[26];
  15. for(int i=0;i<26;i++)
  16. {
  17. c[i] = 0;
  18. }
  19.  
  20. for(int i=0;i<332;i++)
  21. {
  22. char ch = a[i];
  23.  
  24. switch(ch)
  25. {
  26. case 'a' : c[0]++;
  27. break;
  28.  
  29. case 'A' : c[0]++;
  30. break;
  31.  
  32. case 'b' : c[1]++;
  33. break;
  34.  
  35. case 'c' : c[2]++;
  36. break;
  37.  
  38. case 'd' : c[3]++;
  39. break;
  40.  
  41. case 'e' : c[4]++;
  42. break;
  43.  
  44. case 'f' : c[5]++;
  45. break;
  46.  
  47. case 'g' : c[6]++;
  48. break;
  49.  
  50. case 'h' : c[7]++;
  51. break;
  52.  
  53. case 'i' : c[8]++;
  54. break;
  55. case 'j' : c[9]++;
  56. break;
  57.  
  58. case 'k' : c[10]++;
  59. break;
  60.  
  61. case 'l' : c[11]++;
  62. break;
  63.  
  64. case 'm' : c[12]++;
  65. break;
  66.  
  67. case 'n' : c[13]++;
  68. break;
  69.  
  70.  
  71. case 'o' : c[14]++;
  72. break;
  73.  
  74.  
  75.  
  76. case 'p' : c[15]++;
  77. break;
  78.  
  79. case 'q' : c[16]++;
  80. break;
  81.  
  82. case 'r' : c[17]++;
  83. break;
  84.  
  85. case 's' : c[18]++;
  86. break;
  87.  
  88. case 't' : c[19]++;
  89. break;
  90. case 'u' : c[20]++;
  91. break;
  92.  
  93. case 'v' : c[21]++;
  94. break;
  95.  
  96. case 'w' : c[22]++;
  97.  
  98. break;
  99.  
  100. case 'x' : c[23]++;
  101. break;
  102.  
  103. case 'y' : c[24]++;
  104. break;
  105.  
  106.  
  107. case 'z' : c[25]++;
  108. break;
  109.  
  110. case 'M' : c[12]++;
  111. break;
  112.  
  113. case 'P' : c[14]++;
  114. break;
  115.  
  116. default : break;
  117.  
  118. }
  119. }
  120.  
  121. for(int i=0;i<26;i++)
  122. {
  123. cout << c[i] << endl;
  124. }
  125.  
  126. //char ch
  127.  
  128. //switch()
  129. return 0;
  130. }
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
27
3
1
1
22
4
17
14
9
7
6
1
27
6
9
12
0
5
12
6
5
5
25
2
39
0