#include <stdio.h>
#include <stdlib.h>
#include <time.h> //乱数の生成のため
typedef struct {
char na[64];
int stts[6];
} Monster;
Monster creMonster(void){
int i,k;
Monster tmp;
for(i
=0;i
<k
;i
++) tmp.
na[i
] = 'a' + rand()%26; tmp.na[k] = '\0';
for(i
=0;i
<6;i
++) tmp.
stts[i
] = rand()%255+1; return tmp;
}
void priMonster(Monster m){
for(int i=0;i<6;i++)
}
int main(void){
srand((unsigned)time(NULL
)); //乱数を生成する時のおまじない int i, n;
Monster *monsters;
//ここに1行で monstersにn体のモンスターの領域を確保する
monsters
=(Monster
*)malloc(sizeof(Monster
)*n
);
//以下はいじらなくてOK
if(monsters == NULL){
return 0;
}
for(i=0;i<n;i++){
monsters[i] = creMonster();
priMonster(monsters[i]);
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4gLy/kubHmlbDjga7nlJ/miJDjga7jgZ/jgoEKIAp0eXBlZGVmIHN0cnVjdCB7CiAgICBjaGFyIG5hWzY0XTsKICAgIGludCBzdHRzWzZdOwp9IE1vbnN0ZXI7CiAKTW9uc3RlciBjcmVNb25zdGVyKHZvaWQpewogICAgaW50IGksazsKICAgIE1vbnN0ZXIgdG1wOwogICAgayA9IHJhbmQoKSU4KzQ7CiAgICBpbnQgYSA9ICdhJyArIHJhbmQoKSUyNjsKICAgIGZvcihpPTA7aTxrO2krKykgdG1wLm5hW2ldID0gJ2EnICsgcmFuZCgpJTI2OwogICAgdG1wLm5hW2tdID0gJ1wwJzsKICAgIGZvcihpPTA7aTw2O2krKykgdG1wLnN0dHNbaV0gPSByYW5kKCklMjU1KzE7CiAgICByZXR1cm4gdG1wOwp9CiAKdm9pZCBwcmlNb25zdGVyKE1vbnN0ZXIgbSl7CiAgICBwcmludGYoIiUxMnMgIDogIixtLm5hKTsKICAgIGZvcihpbnQgaT0wO2k8NjtpKyspCiAgICAgICAgcHJpbnRmKCIlM2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