Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char str[256]="";
- char alph[52];
- int i;
- for(i=0;i<26;i++)
- {
- alph[i]=i+65;
- }
- cout << "Wwedi stroku : ";
- cin.getline (str,256);
- int b,d=0;
- for(i=0;i<256;i++)
- {
- if(str[i]>='a'&&str[i]<='z')
- {
- str[i]=str[i]-32;
- }
- }
- for(i=0;i<26;i++)
- {
- for(b=0;b<256;b++)
- {
- if(str[b]==alph[i])
- {
- d++;
- }
- }
- if(d>0)
- {
- cout << alph[i] << "-"<< d<< endl;
- }
- d=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement