Advertisement
Stefan08

varianta80_II_5

Nov 17th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <cstring>
  2. #include <iostream>
  3. using namespace std;
  4. char v[21],aux;
  5. int main()
  6. {
  7. int i,ok=0,ok1=0,pozv,pozc;
  8. cin>>v;
  9. for(i=0;i<strlen(v);i++)
  10. {
  11. if(strchr("aeiouAEIOU",v[i])==0)
  12. {
  13. ok++;
  14. if(ok==1)
  15. {
  16. pozc=i;
  17. }
  18. }
  19. else
  20. {
  21. ok1++;
  22. pozv=i;
  23. }
  24. }
  25. if(ok!=0 && ok1!=0)
  26. {
  27. aux=v[pozc];
  28. v[pozc]=v[pozv];
  29. v[pozv]=aux;
  30. cout<<v;
  31. }
  32. else
  33. cout<<"IMPOSIBIL";
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement