Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. { int a,b,c,d,e,f;
  6.  
  7. printf("DODAWANIE MACIERZY\n\n");
  8. printf("Podaj liczbe wierszy macierzy:");
  9. scanf("%d",&a);
  10. printf("Podaj liczbe kolumn macierzy:");
  11. scanf("%d",&b);
  12.  
  13. int tab[a][b];
  14. printf("Wpisz element pierwszej macierzy\n");
  15.  
  16. for(c=0;c<a;c++){
  17. for(d=0;d<b;d++)
  18. {printf("Podaj element:"); scanf("%d",&tab[c][d]);}
  19.  
  20. }
  21. printf("Macierz:\n");
  22. for(c=0;c<a;c++){printf("\n");
  23. for(d=0;d<b;d++)
  24. {printf("%d",tab[c][d]);}
  25.  
  26.  
  27. }
  28.  
  29. printf("\nWpisz element drugiej macierzy\n");
  30.  
  31. for(e=0;e<a;e++){
  32. for(f=0;f<b;f++)
  33. {printf("Podaj element:"); scanf("%d",&tab[e][f]);}
  34.  
  35. }
  36. printf("Macierz:\n");
  37. for(e=0;e<a;e++){printf("\n");
  38. for(f=0;f<b;f++)
  39. {printf("%d",tab[e][f]);}
  40.  
  41.  
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement