#include <stdio.h>
#include <stdlib.h>
//必要があれば変数などを追加してもOKです
int main() {
int i, j, k = 1;
int a, b;
int** mat;
//ここで2次元配列の動的確保をする
mat
= (int**)malloc(sizeof(int*) * a
); if(mat==NULL){
return 0;
}
for(i=0; i<a; i++){
mat
[i
] = (int*)malloc(sizeof(int) * b
); if(mat[i]==NULL){
return 0;
}
}
//ここで2次元配列に数値を代入する
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
mat[i][j] = k++;
}
}
//以下の部分は表示の部分です
//いじらなくてOK
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
}
}
//さて,最後に忘れずにすることと言えば?
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCi8v5b+F6KaB44GM44GC44KM44Gw5aSJ5pWw44Gq44Gp44KS6L+95Yqg44GX44Gm44KCT0vjgafjgZkKCmludCBtYWluKCkgewogICAgaW50IGksIGosIGsgPSAxOwogICAgaW50IGEsIGI7CiAgICBpbnQqKiBtYXQ7CiAgICBzY2FuZigiJWQgJWQiLCAmYSwgJmIpOwoKICAgIC8v44GT44GT44GnMuasoeWFg+mFjeWIl+OBruWLleeahOeiuuS/neOCkuOBmeOCiwogICAgCgoKICAgIG1hdCA9IChpbnQqKiltYWxsb2Moc2l6ZW9mKGludCopICogYSk7CiAgICBpZihtYXQ9PU5VTEwpewogICAgCXByaW50ZigiRVJST1IiKTsKICAgIAlyZXR1cm4gMDsKICAgIH0KICAgIAogICAgZm9yKGk9MDsgaTxhOyBpKyspewogICAgbWF0W2ldID0gKGludCopbWFsbG9jKHNpemVvZihpbnQpICogYik7CiAgICBpZihtYXRbaV09PU5VTEwpewogICAgCXByaW50ZigiRVJST1IiKTsKICAgIAlyZXR1cm4gMDsKICAgIH0KfQoKICAgIC8v44GT44GT44GnMuasoeWFg+mFjeWIl+OBq+aVsOWApOOCkuS7o+WFpeOBmeOCiwogICAgZm9yIChpID0gMDsgaSA8IGE7IGkrKykgewogICAgICAgIGZvciAoaiA9IDA7IGogPCBiOyBqKyspIHsKICAgICAgICAgICAgbWF0W2ldW2pdID0gaysrOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CgoKICAgIC8v5Lul5LiL44Gu6YOo5YiG44Gv6KGo56S644Gu6YOo5YiG44Gn44GZCiAgICAvL+OBhOOBmOOCieOBquOBj+OBpk9LCiAgICBmb3IgKGkgPSAwOyBpIDwgYTsgaSsrKSB7CiAgICAgICAgZm9yIChqID0gMDsgaiA8IGI7IGorKykgewogICAgICAgICAgICBwcmludGYoIiVkICIsIG1hdFtpXVtqXSk7CiAgICAgICAgfQogICAgICAgIHByaW50ZigiXG4iKTsKICAgIH0KCiAgICAvL+OBleOBpu+8jOacgOW+jOOBq+W/mOOCjOOBmuOBq+OBmeOCi+OBk+OBqOOBqOiogOOBiOOBsO+8nwogICAgZnJlZShtYXQpOwoKICAgIHJldHVybiAwOwp9Cg==