Advertisement
MochaGovno

strings

May 23rd, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. strings
  2. #include <iostream.h>
  3. #include <string.h>
  4.  
  5. main()
  6. {char *p, s[100], ss[50],ss1[50];
  7.   int i,col;
  8.     printf("Vvedite stroku 1 (max=100 sim)\n");
  9.     gets(ss);
  10.     printf("Vvedite stroku 2 (max=100 sim)\n");
  11.     gets(ss1);
  12.  
  13.  
  14.  
  15.     p=strtok (ss," ");
  16.     for (i=0;p != NULL;i++)
  17.         {
  18.             strcat(s,p);
  19.             strcat(s," ");
  20.             p=strtok (NULL, " ");
  21.         }
  22.  
  23.     p=strtok (ss1," ");
  24.     strcat(s,p);
  25.  
  26. //    strrev(s);
  27.     strcpy(ss,"");
  28.  
  29.     p=strtok(s," ");
  30.     p=strtok (NULL, " ");
  31.     for (col=i,i=0;i<=col-1;i++)
  32.         {
  33.             strcat(ss,p);
  34.             strcat(ss," ");
  35.             p=strtok (NULL, " ");
  36.         }
  37.  
  38.    // strrev(ss);
  39.     puts(ss);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement