#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;
int a
= 'a' + rand() % 26; 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+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4gCgp0eXBlZGVmIHN0cnVjdCB7CiAgICBjaGFyIG5hWzY0XTsKICAgIGludCBzdHRzWzZdOwp9IE1vbnN0ZXI7CgpNb25zdGVyIGNyZU1vbnN0ZXIoKSB7CiAgICBpbnQgaSwgazsKICAgIE1vbnN0ZXIgdG1wOwogICAgayA9IHJhbmQoKSAlIDggKyA0OwogICAgaW50IGEgPSAnYScgKyByYW5kKCkgJSAyNjsKICAgIGZvciAoaSA9IDA7IGkgPCBrOyBpKyspIHRtcC5uYVtpXSA9ICdhJyArIHJhbmQoKSAlIDI2OyAgCiAgICB0bXAubmFba10gPSAnXDAnOyAKICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspIHRtcC5zdHRzW2ldID0gcmFuZCgpICUgMjU1ICsgMTsgCiAgICByZXR1cm4gdG1wOwp9Cgp2b2lkIHByaU1vbnN0ZXIoTW9uc3RlciBtKSB7CiAgICBwcmludGYoIiUxMnMgIDogIiwgbS5uYSk7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IDY7IGkrKykKICAgICAgICBwcmludGYoIiUzZCAiLCBtLnN0dHNbaV0pOwogICAgcHJpbnRmKCJcbiIpO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