Advertisement
-Vizion-

var80_2009_s2_5

Nov 16th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. char x[300], voc[2], cons[2];
  5. int main ()
  6. {
  7.     int n,i,a,b;
  8.     char aux;
  9.     cin>>x;
  10.     n=strlen(x);
  11.     for (i=0;i<=n-1;i++)
  12.     {
  13.         if (strchr("aeiouAEIOU",x[i])!=0)
  14.         {
  15.             voc[0]=x[i];
  16.             a=i;
  17.         }
  18.     }
  19.     for (i=n-1;i>=0;i--)
  20.     {
  21.         if (strchr("aeiouAEIOU",x[i])==0 && toupper(x[i])>='A' && toupper(x[i])<='Z')
  22.         {
  23.             cons[0]=x[i];
  24.             b=i;
  25.         }
  26.     }
  27.     aux=x[a];
  28.     x[a]=x[b];
  29.     x[b]=aux;
  30.     cout<<x;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement