Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- //Text max 200
- //Sa se modifice textul astfel incat cuvintele care incep cu o vocala
- //sa fie integral transformate in majuscule
- //iar cele care incep cu o consoana sa fie transformate prin oglindire
- //ex: vlad si diana invata foarte incet
- // dalv is anaid INVATA etraof INCET
- int main()
- {
- char s[201], aux;
- int i, j, k;
- cin.get(s, 201);
- i=j=0;
- while(j<strlen(s))
- {
- while(s[j]!=' ' && s[j]!='\0')
- j++;
- if(strchr("aeiou", s[i])!=0)
- for(k=i; k<j; k++)
- s[k]-=32;
- else
- for(k=i; k<i+(j-i)/2; k++)
- {
- aux=s[k];
- s[k]=s[j-k+i-1];
- s[j-k+i-1]=aux;
- }
- i=j=j+1;
- }
- cout<<s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement