Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<fstream>
  2. #include<string.h>
  3. #include<stdio.h>
  4. #include<stdlib.h>
  5.  
  6. using namespace std;
  7.  
  8. int main(){
  9. string str = "ionel";
  10. char checkCharacter[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'};
  11.  
  12. int count = 0;
  13. for(int i=0; i < 27; i++){
  14. count = 0;
  15. for (int j = 0; j < str.size(); j++)
  16. {
  17. if (str[j] == checkCharacter[i])
  18. {
  19. ++ count;
  20. }
  21. }
  22. if(count != 0)
  23. {
  24. cout << "Number of " << checkCharacter[i] << " = " << count<<endl;
  25. }
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement