Falu

Untitled

Jun 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <cctype>
  4.  
  5. using namespace std;
  6.  
  7. int ileWystapienZnakuWNapisie( char z, char * napis )
  8. {
  9.     int ile = 0;
  10.     char litera = toupper(z);
  11.     int rozmiar = strlen(napis);
  12.  
  13.     for(int i = 0; i <rozmiar; i++,*napis++)
  14.     {
  15.         *napis=toupper(*napis);
  16.         cout<<*napis;
  17.     }
  18.  
  19.     for(int i = 0; i <rozmiar; i++,*napis--)
  20.     {
  21.     }
  22.  
  23.     for(int j =0; j <rozmiar;j++,*napis++)
  24.         {
  25.             if(*napis==litera) ile++;
  26.         }
  27.     return ile;
  28. }
  29.  
  30. int main()
  31. {
  32.     char znak = 'r';
  33.     char tab[] = "Rower";
  34.     cout <<ileWystapienZnakuWNapisie(znak, tab);
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment