Advertisement
zsoltizbekk

2015.03.25

Mar 25th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.06 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. #define N 15
  6.  
  7. int main()
  8. {
  9.     char s[N], t[N];
  10.     char *p, *r;
  11.     int i;
  12.  
  13.     gets(s);
  14.     printf("|%s|\n", s);
  15.    
  16.     strcpy(t, "korte");
  17. /*
  18.     p=s, r=t;
  19.     while (*r++=*p++)
  20.         ;
  21.     printf("|%s|\n", t);
  22. */
  23. /*
  24.     gets(s);
  25.     printf("|%s|\n", s);
  26.  
  27.     strcpy(t, "korte");
  28.     printf("|%s|\n", t);
  29.  
  30.     strcpy(t, s);
  31.     printf("|%s|\n", t);
  32. */
  33.  
  34. /*
  35.     while (fgets(s, N, stdin) !=NULL)
  36.     {
  37.         for (i=0; s[i]; i++)
  38.             ;
  39.         if (i>0 && s[i-1]== '\n')
  40.             s[i-1]='\0';
  41.         printf("|%s|\n", s);
  42.  
  43.     }
  44. */
  45. /*
  46.     while (fgets(s, N, stdin)!=NULL)
  47.         printf("|%s|\n", s);
  48.  
  49. */
  50.  
  51.     /*
  52.     while (gets(s)!=NULL)
  53.         printf("|%s|\n", s);
  54.         */
  55. /*
  56.     fgets(s, N, stdin);
  57.     printf("|%s|\n", s);
  58.  
  59. */
  60. /*
  61.     scanf("%s", &s[0]);
  62.     printf("|%s|\n", &s[3]);
  63.  
  64.     for (i=0; i<N; i++)
  65.         printf("%2d.: %4d %c\n", i, s[i], s[i]);
  66. */
  67. //    scanf("%s", &s[0]);
  68. //    printf("|%s|", &s[0]);
  69.  
  70.     return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement