Advertisement
EgorPodvalkov

stroki d

Oct 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {int mass=100;
  7. char a[mass];
  8. int c=0;
  9. char d;
  10. int f=0;
  11. int e[mass];
  12. while (mass>c){
  13. e[c]=0;
  14. c++;
  15. }
  16. c=0;
  17. cin.getline(a,mass);
  18. d='A';
  19. while(c<mass){
  20. if(a[c]==d || a[c]==d+32)e[d]++;
  21. c++;
  22. if(a[c]==0){
  23. c=0;
  24. if(d=='Z')break;
  25. d++;
  26. }
  27. }
  28. c=0;
  29. while(mass>c){
  30. a[c]=0;
  31. c++;
  32. }
  33. d='A';
  34. c=0;
  35. while (d<'Z'){
  36. if(e[d]>c)c=e[d];
  37. d++;
  38. }
  39. d='A';
  40. while(c>0){
  41. if(c==e[d]){a[f]=e[d];
  42. f++;}
  43. if(d=='Z'){c--;
  44. d='A'-1;
  45. }
  46. d++;
  47. }
  48. d='A'-1;
  49. f=0;
  50. while(f<25){
  51. d++;
  52. if(d=='Z'+1)d='A';
  53. if(a[f]==0)break;
  54. if(a[f]==e[d]){
  55. c=a[f];
  56. cout << d << "-" << c << endl;
  57. f++;}
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement