#include <stdio.h>
#include <stdlib.h>
#include <time.h> //乱数の生成のため
typedef struct {
char na[64];
int stts[6];
} Monster;
Monster creMonster(){
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(){
srand((unsigned)time(NULL
)); //乱数を生成する時のおまじない int i, n;
Monster *monsters;
monsters
=(int*)malloc(sizeof(int)*n
);//ここに1行で monstersに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/jgoEKCnR5cGVkZWYgc3RydWN0IHsKICAgIGNoYXIgbmFbNjRdOwogICAgaW50IHN0dHNbNl07Cn0gTW9uc3RlcjsKCk1vbnN0ZXIgY3JlTW9uc3RlcigpewogICAgaW50IGksazsKICAgIE1vbnN0ZXIgdG1wOwogICAgayA9IHJhbmQoKSU4KzQ7CiAgICBpbnQgYSA9ICdhJyArIHJhbmQoKSUyNjsKICAgIGZvcihpPTA7aTxrO2krKykgewogICAgCXRtcC5uYVtpXSA9ICdhJyArIHJhbmQoKSUyNjsKICAgIH0KICAgIHRtcC5uYVtrXSA9ICdcMCc7CiAgICAKICAgIGZvcihpPTA7aTw2O2krKyl7CiAgICAJdG1wLnN0dHNbaV0gPSByYW5kKCklMjU1KzE7CiAgICB9CiAgICByZXR1cm4gdG1wOwp9Cgp2b2lkIHByaU1vbnN0ZXIoTW9uc3RlciBtKXsKICAgIHByaW50ZigiJTEycyAgOiAiLG0ubmEpOwogICAgZm9yKGludCBpPTA7aTw2O2krKyl7CiAgICAgICAgcHJpbnRmKCIlM2QgIixtLnN0dHNbaV0pOwogICAgfQogICAgcHJpbnRmKCJcbiIpOwp9CgppbnQgbWFpbigpewogICAgc3JhbmQoKHVuc2lnbmVkKXRpbWUoTlVMTCkpOyAvL+S5seaVsOOCkueUn+aIkOOBmeOCi+aZguOBruOBiuOBvuOBmOOBquOBhAogICAgaW50IGksIG47CiAgICBNb25zdGVyICptb25zdGVyczsKICAgIHNjYW5mKCIlZCIsJm4pOwogICAgbW9uc3RlcnM9KGludCopbWFsbG9jKHNpemVvZihpbnQpKm4pOy8v44GT44GT44Gr77yR6KGM44GnIG1vbnN0ZXJz44GrbuS9k+OBruODouODs+OCueOCv+ODvOOBrumgmOWfn+OCkueiuuS/neOBmeOCiwogICAgCiAgICAvL+S7peS4i+OBr+OBhOOBmOOCieOBquOBj+OBpu+8r++8qwogICAgaWYobW9uc3RlcnMgPT0gTlVMTCl7CiAgICAgICAgcHJpbnRmKCJFUlJPUlxuIik7CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CiAgICBmb3IoaT0wO2k8bjtpKyspewogICAgICAgIG1vbnN0ZXJzW2ldID0gY3JlTW9uc3RlcigpOwogICAgICAgIHByaW50ZigiJTAzZCAgIixpKzEpOwogICAgICAgIHByaU1vbnN0ZXIobW9uc3RlcnNbaV0pOwogICAgfQogICAgZnJlZShtb25zdGVycyk7CiAgICByZXR1cm4gMDsKfQo=