#include <stdio.h>
#include <stdlib.h>
int main() {
int i, j, k;
int a, b;
int **c;
// ここで2次元配列の動的確保をする
c
= (int **)malloc(a
* sizeof(int *)); for (i = 0; i < a; i++)
{
c
[i
] = (int *)malloc(b
* sizeof(int)); }
// ここで2次元配列に数値を代入する
k = 1;
for (i = 0; i < a; i++)
{
for (j = 0; j < b; j++) {
c[i][j] = k++;
}
}
// 以下の部分は表示の部分です
// いじらなくてOK
for (i = 0; i < a; i++)
{
for (j = 0; j < b; j++)
{
}
}
for (i = 0; i < a; i++)
{
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KIAppbnQgbWFpbigpIHsKICAgIGludCBpLCBqLCBrOwogICAgaW50IGEsIGI7CiAgICBpbnQgKipjOwogICAgc2NhbmYoIiVkICVkIiwgJmEsICZiKTsKIAogICAgLy8g44GT44GT44GnMuasoeWFg+mFjeWIl+OBruWLleeahOeiuuS/neOCkuOBmeOCiwogICAgYyA9IChpbnQgKiopbWFsbG9jKGEgKiBzaXplb2YoaW50ICopKTsKICAgIGZvciAoaSA9IDA7IGkgPCBhOyBpKyspCnsKICAgICAgICBjW2ldID0gKGludCAqKW1hbGxvYyhiICogc2l6ZW9mKGludCkpOwogICAgfQogCiAgICAvLyDjgZPjgZPjgacy5qyh5YWD6YWN5YiX44Gr5pWw5YCk44KS5Luj5YWl44GZ44KLCiAgICBrID0gMTsKICAgIGZvciAoaSA9IDA7IGkgPCBhOyBpKyspCnsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgYjsgaisrKSB7CiAgICAgICAgICAgIGNbaV1bal0gPSBrKys7CiAgICAgICAgfQogICAgfQogCiAgICAvLyDku6XkuIvjga7pg6jliIbjga/ooajnpLrjga7pg6jliIbjgafjgZkKICAgIC8vIOOBhOOBmOOCieOBquOBj+OBpk9LCiAgICBmb3IgKGkgPSAwOyBpIDwgYTsgaSsrKQp7CiAgICAgICAgZm9yIChqID0gMDsgaiA8IGI7IGorKykKewogICAgICAgICAgICBwcmludGYoIiVkICIsIGNbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CiAKICAgIAogICAgZm9yIChpID0gMDsgaSA8IGE7IGkrKykKewogICAgICAgIGZyZWUoY1tpXSk7CiAgICB9CiAgICBmcmVlKGMpOwogCiAgICByZXR1cm4gMDsKfQo=