Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <cctype>
- using namespace std;
- int ileWystapienZnakuWNapisie( char z, char * napis )
- {
- int ile = 0;
- char litera = toupper(z);
- int rozmiar = strlen(napis);
- for(int i = 0; i <rozmiar; i++,*napis++)
- {
- *napis=toupper(*napis);
- cout<<*napis;
- }
- for(int i = 0; i <rozmiar; i++,*napis--)
- {
- }
- for(int j =0; j <rozmiar;j++,*napis++)
- {
- if(*napis==litera) ile++;
- }
- return ile;
- }
- int main()
- {
- char znak = 'r';
- char tab[] = "Rower";
- cout <<ileWystapienZnakuWNapisie(znak, tab);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment