Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cctype>
- #include <cstring>
- using namespace std;
- int main()
- {
- char s[256], voc[256]="aeiouAEIOU", aux[255], aux1[255];
- unsigned int i, j, g1, g2;
- g1=g2=0;
- cin.get (s, 256);
- cin.get();
- for (i=0; i<strlen(s); i++)
- if (strchr(voc, s[i]))
- g1=1;
- else g2=1;
- if (g1==1&&g2==1)
- {
- for (j=strlen (s)-1; j>=0; j--)
- if (!strchr(voc, s[j]))
- {
- strcpy (aux1, s+j);
- break;
- }
- for (i=0; i<strlen(s); i++)
- if (strchr(voc, s[i]))
- {
- strcpy (aux, s+i);
- break;
- }
- strcpy(s+i, aux1);
- strcpy(s+i+1, aux+1);
- strncpy(s+j, aux, 1);
- cout<<s;
- }
- else
- cout<<"IMPOSIBIL";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement