Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstring>
- #include <iostream>
- using namespace std;
- char v[21],aux;
- int main()
- {
- int i,ok=0,ok1=0,pozv,pozc;
- cin>>v;
- for(i=0;i<strlen(v);i++)
- {
- if(strchr("aeiouAEIOU",v[i])==0)
- {
- ok++;
- if(ok==1)
- {
- pozc=i;
- }
- }
- else
- {
- ok1++;
- pozv=i;
- }
- }
- if(ok!=0 && ok1!=0)
- {
- aux=v[pozc];
- v[pozc]=v[pozv];
- v[pozv]=aux;
- cout<<v;
- }
- else
- cout<<"IMPOSIBIL";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement