Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Matice
#include <stdio.h> #define SLOUPCE 6 #define RADKY 3 int main(void) { int matA[RADKY][SLOUPCE] = { { 0, 1, 2, 3, 4, 5}, { 6, 7, 8, 9, 10, 11}, {12, 13, 14, 15, 16, 17}, }; int matB[RADKY][SLOUPCE] = { { 0, 1, 2, 3, 4, 5}, { 6, 7, 8, 9, 10, 11}, {12, 13, 14, 15, 16, 17}, }; int matC[RADKY][SLOUPCE]; // Prirazeni matice for(size_t r = 0; r < RADKY; ++r) for(size_t s = 0; s < SLOUPCE; ++s) matC[r][s] = matA[r][s]; // Tisk kopirovane matice printf("\nMatice C:\n"); for(size_t r = 0; r < RADKY; ++r) { for(size_t s = 0; s < SLOUPCE; ++s) printf("%d\t", matC[r][s]); putchar('\n'); } // Scitani matic for(size_t r = 0; r < RADKY; ++r) for(size_t s = 0; s < SLOUPCE; ++s) matC[r][s] = matA[r][s] + matB[r][s]; // Tisk vysledne matice printf("\nSoucet A+B:\n"); for(size_t r = 0; r < RADKY; ++r) { for(size_t s = 0; s < SLOUPCE; ++s) printf("%d\t", matC[r][s]); putchar('\n'); } return 0; } #if 0 // Trolli zahradka #endif
run
|
edit
|
history
|
help
0
bignum test
TStack_array
BPC UDP pr3 cv10 final
makro vzdálenost
Look at the bleeping warnings
BPC UDP pr3 cv10
TStack_list
Empty struct
Ukazatele PR4
inicializace struktury