Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i, w;
- i=0;
- n=0;
- //cout << "podaj ilosc liter" << endl;
- //cin>> n;
- char litery[200];
- char ilosc[8]
- cout << "podaj wyraz" << endl;
- cin >> litery;
- //cout << litery[n-1] << endl;
- for (i=0;i<sizeof(litery)/sizeof(char) ;i++)
- {
- if( litery[i]=='a' )
- {
- ilosc[0]= ilosc[0]+1;
- }
- if( litery[i]=='k' )
- {
- ilosc[1]= ilosc[1]+1;
- }
- if( litery[i]=='l' )
- {
- ilosc[2]= ilosc[2]+1;
- }
- if( litery[i]=='m' )
- {
- ilosc[3]= ilosc[3]+1;
- }
- if( litery[i]=='o' )
- {
- ilosc[4]= ilosc[4]+1;
- }
- if( litery[i]=='p' )
- {
- ilosc[5]= ilosc[5]+1;
- }
- if( litery[i]=='s' )
- {
- ilosc[6]= ilosc[6]+1;
- }
- if( litery[i]=='t' )
- {
- ilosc[7]= ilosc[7]+1;
- }
- }
- cout<<ilosc<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement