SHARE
TWEET

Untitled

a guest Jan 18th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.  
  8.  
  9.     char s[21],dupaEliminare[19],vocale[] = "aeiou";
  10.     cin.get(s,20);
  11.     int i, n = strlen(s),pozitieVocala = -1,h = 0;
  12.     for (i = 0; i < n; i++) {
  13.         if (strchr(vocale,s[i])) {
  14.             if(pozitieVocala == -1) {
  15.                 pozitieVocala = i;
  16.                 continue;
  17.             }
  18.             pozitieVocala = i - 1;
  19.         }
  20.         dupaEliminare[h++] = s[i];
  21.  
  22.     }
  23.     dupaEliminare[h] = NULL;
  24.     strcpy(dupaEliminare + pozitieVocala, dupaEliminare + pozitieVocala + 1);
  25.  
  26.     cout<<dupaEliminare;
  27.  
  28.  
  29.     return 0;
  30. }
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