Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include<string.h>
- #include<stdio.h>
- #include<stdlib.h>
- using namespace std;
- int main(){
- string str = "ionel";
- 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'};
- int count = 0;
- for(int i=0; i < 27; i++){
- count = 0;
- for (int j = 0; j < str.size(); j++)
- {
- if (str[j] == checkCharacter[i])
- {
- ++ count;
- }
- }
- if(count != 0)
- {
- cout << "Number of " << checkCharacter[i] << " = " << count<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement