Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char s[100];
- char sFinal[200] = "";
- cin.getline(s, 100);
- char *cuvant = strtok(s, " ");
- while(cuvant != NULL)
- {
- char auxi[50];
- strcpy(auxi, cuvant);
- for(int i = 0; i < strlen(auxi); i++)
- {
- if(strchr("aeiou", auxi[i]))
- {
- strcpy(auxi + i + 1, auxi + i);
- i = i + 1;
- }
- }
- if(auxi[0] >= 'a' && auxi[0] <= 'z')
- auxi[0] = auxi[0] - 'a' + 'A';
- int lungime = strlen(auxi) - 1;
- if(auxi[lungime] >= 'a' && auxi[lungime] <= 'z')
- auxi[lungime] = auxi[lungime] - 'a' + 'A';
- strcat(sFinal, auxi);
- strcat(sFinal, " ");
- cuvant = strtok(NULL, " ");
- }
- strcpy(s, sFinal);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement