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; }
run
|
edit
|
history
|
help
0
Hello
BPC UDP pr3 cv10 final
Min_Max pole čísel
BPC cv 5_Test
Find integer values of functions of integer values
test
BPC cv5_kvadraticka - final
Ukazatele PR4
TVector
hrátky s ukazately ++ bonusy ++ profi swap