Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strings
- #include <iostream.h>
- #include <string.h>
- main()
- {char *p, s[100], ss[50],ss1[50];
- int i,col;
- printf("Vvedite stroku 1 (max=100 sim)\n");
- gets(ss);
- printf("Vvedite stroku 2 (max=100 sim)\n");
- gets(ss1);
- p=strtok (ss," ");
- for (i=0;p != NULL;i++)
- {
- strcat(s,p);
- strcat(s," ");
- p=strtok (NULL, " ");
- }
- p=strtok (ss1," ");
- strcat(s,p);
- // strrev(s);
- strcpy(ss,"");
- p=strtok(s," ");
- p=strtok (NULL, " ");
- for (col=i,i=0;i<=col-1;i++)
- {
- strcat(ss,p);
- strcat(ss," ");
- p=strtok (NULL, " ");
- }
- // strrev(ss);
- puts(ss);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement