fork download
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5. char s[12];
  6. int i,gasit,c=-1,aux,d=-1;
  7.  
  8. int main()
  9. {
  10. cin.getline(s,11);
  11. gasit=0;
  12. for(i=0;i<strlen(s);i++)
  13. if(s[i]=='a' or s[i]=='e' or s[i]=='i' or s[i]=='o' or s[i]=='u')
  14. {
  15. if(gasit==0)
  16. {
  17. gasit=1;
  18. d=i;
  19. }
  20. }
  21. else
  22. c=i;
  23. if(c==-1 or d==-1)
  24. cout<<"IMPOSIBIL";
  25. else if(gasit==1 && d>=0)
  26. {
  27. aux=s[d];
  28. s[d]=s[c];
  29. s[c]=aux;
  30.  
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0.01s 5320KB
stdin
 
stdout
IMPOSIBIL