#include <stdio.h>
#include <stdlib.h>
//必要があれば変数などを追加してもOKです
int main(){
int i, j, k;
int a, b;
int **mat;
// ここで2次元配列の動的確保をする
mat
= (int **)malloc(a
* sizeof(int *)); for (i = 0; i < a; i++) {
mat
[i
] = (int *)malloc(b
* sizeof(int)); }
// ここで2次元配列に数値を代入する
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
// ここでは例として、インデックスの和を代入します
mat[i][j] = i + j;
}
}
// 以下の部分は表示の部分です
// いじらなくてOK
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
}
}
// 最後に忘れずにすること:動的に確保したメモリを解放する
for (i = 0; i < a; i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCi8v5b+F6KaB44GM44GC44KM44Gw5aSJ5pWw44Gq44Gp44KS6L+95Yqg44GX44Gm44KCT0vjgafjgZkKCmludCBtYWluKCl7CiAgICBpbnQgaSwgaiwgazsKICAgIGludCBhLCBiOwogICAgaW50ICoqbWF0OwogICAgc2NhbmYoIiVkICVkIiwgJmEsICZiKTsKCiAgICAvLyDjgZPjgZPjgacy5qyh5YWD6YWN5YiX44Gu5YuV55qE56K65L+d44KS44GZ44KLCiAgICBtYXQgPSAoaW50ICoqKW1hbGxvYyhhICogc2l6ZW9mKGludCAqKSk7CiAgICBmb3IgKGkgPSAwOyBpIDwgYTsgaSsrKSB7CiAgICAgICAgbWF0W2ldID0gKGludCAqKW1hbGxvYyhiICogc2l6ZW9mKGludCkpOwogICAgfQoKICAgIC8vIOOBk+OBk+OBpzLmrKHlhYPphY3liJfjgavmlbDlgKTjgpLku6PlhaXjgZnjgosKICAgIGZvciAoaSA9IDA7IGkgPCBhOyBpKyspIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgYjsgaisrKSB7CiAgICAgICAgICAgIC8vIOOBk+OBk+OBp+OBr+S+i+OBqOOBl+OBpuOAgeOCpOODs+ODh+ODg+OCr+OCueOBruWSjOOCkuS7o+WFpeOBl+OBvuOBmQogICAgICAgICAgICBtYXRbaV1bal0gPSBpICsgajsKICAgICAgICB9CiAgICB9CgogICAgLy8g5Lul5LiL44Gu6YOo5YiG44Gv6KGo56S644Gu6YOo5YiG44Gn44GZCiAgICAvLyDjgYTjgZjjgonjgarjgY/jgaZPSwogICAgZm9yIChpID0gMDsgaSA8IGE7IGkrKykgewogICAgICAgIGZvciAoaiA9IDA7IGogPCBiOyBqKyspIHsKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLCBtYXRbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CgogICAgLy8g5pyA5b6M44Gr5b+Y44KM44Ga44Gr44GZ44KL44GT44Go77ya5YuV55qE44Gr56K65L+d44GX44Gf44Oh44Oi44Oq44KS6Kej5pS+44GZ44KLCiAgICBmb3IgKGkgPSAwOyBpIDwgYTsgaSsrKSB7CiAgICAgICAgZnJlZShtYXRbaV0pOwogICAgfQogICAgZnJlZShtYXQpOwoKICAgIHJldHVybiAwOwp9Cg==