Advertisement
mailnesia

Untitled

May 4th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.00 KB | None | 0 0
  1. #include <stdio.h>
  2. #define W 3
  3. #define K 9
  4. main(){
  5.     char t[W][K] = {
  6.         {'B', 'a', 'l', 't', 'y', 'c', 'k', 'i'},
  7.         {'F','e','s','t','i','w','a','l'},
  8.         {'N','a','u','k','i'}
  9.     };
  10.     int i;
  11.     for(i = 0 ; i < W ; i++ )
  12.         printf("%s ", t[i] );
  13. }
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. #include <stdio.h>
  25. #define N 10
  26. main(){
  27.     char t[N];
  28.  
  29.     fgets(t,N,stdin);
  30.     puts("Podany lancuch to:");
  31.     puts(t);
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. #include <stdio.h>
  52. #define N 5
  53. main(){
  54.     int c, i;
  55.     char t[N];
  56.     i = 0;
  57.     do {
  58.         getchar();
  59.         if( EOF == c || N-1 == i )
  60.             t[i] = '\0';
  61.         else
  62.             t[i] = c;
  63.         i++;
  64.     }while( EOF != c && i<N );
  65.     printf("Podany lancuch znakow to: _%s_", t);
  66. }
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. #include <stdio.h>
  84. //program powinien wydrukowac wprowadzony znak
  85. main(){
  86.     char c;
  87.  
  88.     puts("Podaj jeden znak:");
  89.     c = getchar();
  90.     puts("Podany znak to:");
  91.     c = putchar(c);
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement