Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- char x[300], voc[2], cons[2];
- int main ()
- {
- int n,i,a,b;
- char aux;
- cin>>x;
- n=strlen(x);
- for (i=0;i<=n-1;i++)
- {
- if (strchr("aeiouAEIOU",x[i])!=0)
- {
- voc[0]=x[i];
- a=i;
- }
- }
- for (i=n-1;i>=0;i--)
- {
- if (strchr("aeiouAEIOU",x[i])==0 && toupper(x[i])>='A' && toupper(x[i])<='Z')
- {
- cons[0]=x[i];
- b=i;
- }
- }
- aux=x[a];
- x[a]=x[b];
- x[b]=aux;
- cout<<x;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement