Facebook
From Cute Bat, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 58
  1. string char_to_string(char c)
  2. {
  3.     stringstream ss;
  4.     ss << c;
  5.     string s;
  6.     ss >> s;
  7.     return s;
  8. }
  9.  
  10.  
  11. void zadanie3()
  12. {
  13.     string a;
  14.     char tab[6];
  15.     vector<string>vowel;
  16.     ifstream in("tekst.txt");
  17.     ofstream of("wyniki.txt");
  18.  
  19.     for(int i=0; i<1876; i++)
  20.     {
  21.         in >> a;
  22.         for(int j=0; j<a.length(); j++)
  23.         {
  24.             if(a[j]==char_to_string('A') || a[j]==char_to_string('E') || a[j]==char_to_string('I') || a[j]==char_to_string('O') || a[j]==char_to_string('U') || a[j]==char_to_string('Y'))
  25.                cout << a[j];
  26.         }
  27.         cout << endl;
  28.     }
  29. }
  30.