Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. char s[11],aux,aux1;
  6. char vocale[]="aeiou";
  7. cin.get(s,11);
  8. int i,ok=1,poz,poz1=-1,nr=0;
  9. for(i=0;i<strlen(s);i++)
  10. {
  11. if((s[i]=='u' || s[i]=='U' || s[i]=='a' || s[i]=='A' || s[i]=='e' || s[i]=='E' || s[i]=='o' || s[i]=='O' || s[i]=='i' || s[i]=='I') && (ok==1)) {aux=s[i];poz=i;ok=0;}
  12.  
  13. }
  14.  
  15. for(i=0;i<strlen(s);i++)
  16. {
  17.  
  18. if((s[i]!='u' && s[i]!='U' && s[i]!='a' && s[i]!='A' && s[i]!='e' && s[i]!='E' && s[i]!='o' && s[i]!='O' && s[i]!='i ' && s[i]!='I')) {aux1=s[i];poz1=i;nr++;}
  19. }
  20.  
  21. if(nr==0) cout<<"IMPOSIBIL";
  22. else
  23. {
  24. s[poz]=aux1;
  25. s[poz1]=aux;
  26. cout<<s;
  27. }
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement