Advertisement
Guest User

98765678765567

a guest
Jan 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.    char str[256]="";
  8.    char alph[52];
  9.    int i;
  10.    for(i=0;i<26;i++)
  11.    {
  12.        alph[i]=i+65;
  13.    }
  14.    cout << "Wwedi stroku : ";
  15.    cin.getline (str,256);
  16.    int b,d=0;
  17.    for(i=0;i<256;i++)
  18.     {
  19.         if(str[i]>='a'&&str[i]<='z')
  20.         {
  21.             str[i]=str[i]-32;
  22.         }
  23.     }
  24.    for(i=0;i<26;i++)
  25.    {
  26.        for(b=0;b<256;b++)
  27.        {
  28.            if(str[b]==alph[i])
  29.            {
  30.                d++;
  31.            }
  32.        }
  33.        if(d>0)
  34.        {
  35.            cout << alph[i] << "-"<< d<< endl;
  36.        }
  37.        d=0;
  38.    }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement