Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. ///Text max 200. Sa se modifice textul a.i. cuv care incep cu o vocala sa fie integral transformate in majuscule
  5. ///iar cele care incep cu o consoana oglindite
  6. ///vlad si diana invata foarte incet => dalv is anaid INVARTA etraof INCET
  7.  
  8. int main()
  9. {
  10. int i=0, j=0;
  11. char s[201];
  12. cin.get(s,201);
  13. while(j<strlen(s))
  14. {
  15. while(s[j]!=' ' && s[j]!='\0')
  16. j++;
  17. if(strchr("aeiou",s[i])!=0)
  18. for(int c=i; c<=j-1; c++)
  19. s[c]=s[c]-32;
  20. else
  21. for(int c=i; c<=i+(j-i)/2-1; c++)
  22. {
  23. char aux=s[c];
  24. s[c]=s[j+i-c-1];
  25. s[j+i-c-1]=aux;
  26. }
  27. i=j=j+1;
  28. }
  29. cout<<s;
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement