Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- char s[11],aux,aux1;
- char vocale[]="aeiou";
- cin.get(s,11);
- int i,ok=1,poz,poz1=-1,nr=0;
- for(i=0;i<strlen(s);i++)
- {
- 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;}
- }
- for(i=0;i<strlen(s);i++)
- {
- 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++;}
- }
- if(nr==0) cout<<"IMPOSIBIL";
- else
- {
- s[poz]=aux1;
- s[poz1]=aux;
- cout<<s;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement