daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int znajdz_ilosc_znakow(const char* tablica, const char* tablica_znakow){
  7.     int ilosc_znakow=0;
  8.     for(int i=0; i<strlen(tablica_znakow);i++){
  9.         for(int j=0; j<strlen(tablica); j++){
  10.             if(tablica_znakow[i]==tablica[j]){
  11.                 ilosc_znakow++;
  12.             }
  13.         }
  14.     }
  15.     return ilosc_znakow;
  16. }
  17. int main(){
  18.     char tablica[] = "Ola ma psa, a pies ma Ole.";
  19.     char tablica_znakow[] = {',', '.', '!', '?',':',';'};
  20.     cout << "Ilosc znakow interpunkcyjnych, to: " << znajdz_ilosc_znakow(tablica, tablica_znakow);
  21.     return 0;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top