SHARE
TWEET

Untitled

a guest Jan 24th, 2020 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. bool czy5ZRzedu(string slowo){
  7.     int licznik=0, max=0;
  8.     char spol[]={'b','c','d','f','g','h','j','k','l','m','n','p','r','s','t','w','z','B','C','D','F','G','H','J','K','L','M','N','P','R','S','T','W','Z'};
  9.     for(int i=0;i<slowo.length();i++){
  10.         int pom=0;
  11.         for(int j=0;j<34;j++){
  12.             if(slowo[i]==spol[j]) pom++;
  13.         }
  14.         if(pom==1) licznik++;
  15.         else {
  16.             if(licznik>max) max=licznik;
  17.             licznik=0;
  18.         }
  19.     }
  20.     if(licznik>max) max=licznik;
  21.     if(max>=5) return true;
  22.     else return false;
  23. }
  24.  
  25. int main(){
  26.  
  27.     string slowo;
  28.     ifstream odczyt("slownik.txt");
  29.     ofstream zapis("chuj.txt");
  30.     while(!odczyt.eof()){
  31.         odczyt>>slowo;
  32.         if(czy5ZRzedu(slowo)==true) zapis<<slowo<<endl;
  33.     }
  34.     return 0;
  35. }
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