Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- void rev(char s[]) {
- int n = (int) strlen(s);
- for(int i = 0; i < n/2; ++i) {
- char c = s[i];
- s[i] = s[n-1-i];
- s[n-1-i] = c;
- }
- }
- int main() {
- char s[256];
- cin.get(s, 255);
- cin.get();
- int n = (int) strlen(s);
- char t[256] = "";
- char *p = strtok(s, " ");
- while(p) {
- if(strchr("aeiou", *p)) {
- rev(p);
- }
- strcat(t, p);
- strcat(t, " ");
- p = strtok(NULL, " ");
- }
- strcpy(s, t);
- cout << s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement