Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char text[101], *p, aux[101];
- int l;
- cin.get(text ,101);
- int ok=0;
- p=strtok(text, " ");
- while(p)
- {
- l=strlen(p);
- if(l>=3);
- {
- ok=1;
- char pl=p[0];
- strcpy(p, p+1);
- p[l-1]=pl;
- p[l]=NULL;
- }
- strcat(aux, p);
- strcat(aux, " ");
- p=strtok(NULL, " ");
- }
- if(ok==0)
- cout<<"Nu exista";
- else
- {
- strcpy(text, aux);
- cout<<text;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement