#include <stdio.h>
#include <stdlib.h>
//必要があれば変数などを追加してもOKです
int main(){
int i,j,k,l;
int a,b;
int **mat;
mat
=(int**)malloc(a
*sizeof(int*)); if ((mat
= (int **)malloc(sizeof(int*)*a
)) == NULL
){ }
for(i=0;i<b;i++) {
mat
[i
]=(int *)malloc(b
*sizeof(int)); }
for(i=0;i<b;i++) {
if ((mat
[i
] = (int *)malloc(sizeof(int)*b
)) == NULL
){ }
}
//ここで2次元配列の動的確保をする
l=1;
for(j=0;j<a;j++){
for(k=0;k<b;k++){
mat[j][k]=l;
l=l+1;
}
}
//ここで2次元配列に数値を代入する
//以下の部分は表示の部分です
//いじらなくてOK
for(i=0;i<a;i++){
for(j=0;j<b;j++){
}
}
//さて,最後に忘れずにすることと言えば?
for (int i = 0; i < a; i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KIAovL+W/heimgeOBjOOBguOCjOOBsOWkieaVsOOBquOBqeOCkui/veWKoOOBl+OBpuOCgk9L44Gn44GZCiAKaW50IG1haW4oKXsKICAgIGludCBpLGosayxsOwogICAgaW50IGEsYjsKICAgIGludCAqKm1hdDsKICAgIHNjYW5mKCIlZCAlZCIsJmEsJmIpOwogCiAgICBtYXQ9KGludCoqKW1hbGxvYyhhKnNpemVvZihpbnQqKSk7CiAgICBpZiAoKG1hdCA9IChpbnQgKiopbWFsbG9jKHNpemVvZihpbnQqKSphKSkgPT0gTlVMTCl7CiAgICBwcmludGYoIkVSUk9SXG4iKTsKICAgIH0KICAgCiAgICBmb3IoaT0wO2k8YjtpKyspIHsKICAgICAgICBtYXRbaV09KGludCAqKW1hbGxvYyhiKnNpemVvZihpbnQpKTsKICAgIH0KICAgIGZvcihpPTA7aTxiO2krKykgewogICAgaWYgKChtYXRbaV0gPSAoaW50ICopbWFsbG9jKHNpemVvZihpbnQpKmIpKSA9PSBOVUxMKXsKICAgIHByaW50ZigiRVJST1JcbiIpOwogICAgfQogICAgfQogICAgICAgIAoKCS8v44GT44GT44GnMuasoeWFg+mFjeWIl+OBruWLleeahOeiuuS/neOCkuOBmeOCiwogICAgCiAgICBsPTE7CiAgICBmb3Ioaj0wO2o8YTtqKyspewogICAgICAgIGZvcihrPTA7azxiO2srKyl7CiAgICAgICAgICAgbWF0W2pdW2tdPWw7CiAgICAgICAgICAgIGw9bCsxOwogICAgICAgIH0KICAgIH0KIAoJLy/jgZPjgZPjgacy5qyh5YWD6YWN5YiX44Gr5pWw5YCk44KS5Luj5YWl44GZ44KLCiAKIAogICAgLy/ku6XkuIvjga7pg6jliIbjga/ooajnpLrjga7pg6jliIbjgafjgZkKICAgIC8v44GE44GY44KJ44Gq44GP44GmT0sKICAgIGZvcihpPTA7aTxhO2krKyl7CiAgICAgICAgZm9yKGo9MDtqPGI7aisrKXsKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLG1hdFtpXVtqXSk7CiAgICAgICAgfQogICAgICAgIHByaW50ZigiXG4iKTsKICAgIH0KIAogICAgLy/jgZXjgabvvIzmnIDlvozjgavlv5jjgozjgZrjgavjgZnjgovjgZPjgajjgajoqIDjgYjjgbDvvJ8KICAgIGZvciAoaW50IGkgPSAwOyBpIDwgYTsgaSsrKSB7CiAgICAgICAgZnJlZShtYXRbaV0pOwogICAgfQogICAgZnJlZShtYXQpOwogCiAKICAgIHJldHVybiAwOwp9Cg==