Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include "iostream"
  2. #include "conio.h"
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int z, licz[26] = { 0 };
  9. do
  10. {
  11.  
  12. cout << "Podaj litere: ";
  13. z = getchar();
  14. licz[z - 97]++;
  15. } while (getchar() != ' ');
  16. for (int i = 0; i <= 26; i++)
  17. {
  18. cout << char(i + 97) << " - " << licz[i] << " - ";
  19. if (licz[i] != 0)
  20. {
  21. for (int j = 1; j <= licz[i]; j++)
  22. cout << "#";
  23. }
  24. cout << endl;
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement