Advertisement
Wolfrost

trovaVocali

Dec 9th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. vector<char> trovaVocali(string str) {
  2.     int strlen = str.length();
  3.     vector<char> chvec;
  4.     int chvec_pointer = 0;
  5.     for (int i=0; i<strlen; i++) {
  6.         string sub = str.substr(i,1);
  7.         if (sub=="a"||sub=="e"||sub=="i"||sub=="o"||sub=="u") {
  8.             chvec.at(chvec_pointer) = sub;
  9.             chvec_pointer++;
  10.         }
  11.         sub = "";
  12.     }
  13.     return chvec;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement