#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(){
int i, n;
Monster *monsters;
monsters
= (Monster
*)malloc(n
* sizeof(Monster
));
if(monsters == NULL){
return 0;
}
for(i = 0; i < n; i++){
monsters[i] = creMonster();
priMonster(monsters[i]);
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4gCgp0eXBlZGVmIHN0cnVjdCB7CiAgICBjaGFyIG5hWzY0XTsKICAgIGludCBzdHRzWzZdOwp9IE1vbnN0ZXI7CgpNb25zdGVyIGNyZU1vbnN0ZXIoKXsKICAgIGludCBpLCBrOwogICAgTW9uc3RlciB0bXA7CiAgICBrID0gcmFuZCgpICUgOCArIDQ7CiAgICBmb3IoaSA9IDA7IGkgPCBrOyBpKyspIHRtcC5uYVtpXSA9ICdhJyArIHJhbmQoKSAlIDI2OwogICAgdG1wLm5hW2tdID0gJ1wwJzsKICAgIGZvcihpID0gMDsgaSA8IDY7IGkrKykgdG1wLnN0dHNbaV0gPSByYW5kKCkgJSAyNTUgKyAxOwogICAgcmV0dXJuIHRtcDsKfQoKdm9pZCBwcmlNb25zdGVyKE1vbnN0ZXIgbSl7CiAgICBwcmludGYoIiUxMnMgIDogIiwgbS5uYSk7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgNjsgaSsrKQogICAgICAgIHByaW50ZigiJTNkICIsIG0uc3R0c1tpXSk7CiAgICBwcmludGYoIlxuIik7Cn0KCmludCBtYWluKCl7CiAgICBzcmFuZCgodW5zaWduZWQpdGltZShOVUxMKSk7IAogICAgaW50I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