Advertisement
MateuszGgG

zad 4 a rev 0

Dec 5th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <Windows.h>
  3. #include <string.h>
  4. #include <stdlib.h>
  5.  
  6.  
  7. #define ILE 3
  8. char ss[ILE][255];
  9. int i, j, k;
  10. int main(void)
  11. {
  12.    
  13.  
  14.     for (k = 0; k < ILE; ++k)
  15.     {
  16.         printf("Podaj dane nr %i", k + 1);
  17.         printf("\n");
  18.         scanf_s("%s", ss[k], sizeof(ss[k]));
  19.            
  20.     }
  21.  
  22.  
  23.  
  24.     printf("  1 2 3 4 5\n"); //drukowanie poziomej numeracji tabeli
  25.     for (i = 0; i <= 4; ++i) {
  26.         printf("%d ", i + 1);//drukowanie pionowej numeracji tabeli
  27.         for (j = 0; j <= 4; ++j) {
  28.  
  29.             if (strcmp(ss[i], ss[j]) == 0)
  30.                 printf("R ");
  31.             else
  32.                 printf("N ");//funkcja porównująca wartości wskaźnika ss równość zapisuje jako R a nierówność jako N
  33.         }
  34.         printf("\n");
  35.     }
  36.  
  37.  
  38.     system("pause"); //zatrzymanie okna konsoli
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement