generated from justuser-31/code_projects_template
add
This commit is contained in:
parent
2c6be6ae06
commit
4f3ef139d0
36
STEP1_Basics/4_Double_array/main.c
Normal file
36
STEP1_Basics/4_Double_array/main.c
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int matrix[10][10];
|
||||||
|
|
||||||
|
for (int x = 0; x < 10; x++) {
|
||||||
|
for (int y = 0; y < 10; y++) {
|
||||||
|
matrix[x][y] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int x = 0; x < 10; x++) {
|
||||||
|
matrix[x][0] = x;
|
||||||
|
}
|
||||||
|
for (int y = 0; y < 10; y++) {
|
||||||
|
matrix[0][y] = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int x = 0; x < 10; x++) {
|
||||||
|
for (int y = 0; y < 10; y++) {
|
||||||
|
matrix[x][y] = x * y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int x = 0; x < 10; x++) {
|
||||||
|
for (int y = 0; y < 10; y++) {
|
||||||
|
if (matrix[x][y] > 9) {
|
||||||
|
printf("%d ", matrix[x][y]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("%d ", matrix[x][y]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user