Advertisement
rotti321

eliminare bac 2016

Mar 14th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. ////eliminare bac 2016
  2.  
  3. #include <iostream>
  4. #include <cstring>
  5. int v[1000001];
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.    char s[256],voc[10]="aeiou";
  11.    cin.getline(s,256);
  12.    int k=0;
  13.    for(int i=0;i<strlen(s);i++){
  14.     if(s[i]!='m')
  15.     {
  16.         if(strchr(voc,s[i])!=NULL)
  17.         {
  18.             k++; ///contorizez vocalele
  19.  
  20.         }
  21.         else{
  22.             strcpy(s+i,s+i+1);i--;
  23.         }
  24.     }
  25.    }
  26.    if(k==0)
  27.     cout<<"nu exista";
  28.    else
  29. cout<<s;
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement