#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+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4gCgp0eXBlZGVmIHN0cnVjdCB7CiAgICBjaGFyIG5hWzY0XTsKICAgIGludCBzdHRzWzZdOwp9IE1vbnN0ZXI7CgpNb25zdGVyIGNyZU1vbnN0ZXIoKSB7CiAgICBpbnQgaSwgazsKICAgIE1vbnN0ZXIgdG1wOwogICAgayA9IHJhbmQoKSAlIDggKyA0OwogICAgZm9yIChpID0gMDsgaSA8IGs7IGkrKykgCiAgICAgICAgdG1wLm5hW2ldID0gJ2EnICsgcmFuZCgpICUgMjY7CiAgICB0bXAubmFba10gPSAnXDAnOwogICAgZm9yIChpID0gMDsgaSA8IDY7IGkrKykgCiAgICAgICAgdG1wLnN0dHNbaV0gPSByYW5kKCkgJSAyNTUgKyAxOwogICAgcmV0dXJuIHRtcDsKfQoKdm9pZCBwcmlNb25zdGVyKE1vbnN0ZXIgbSkgewogICAgcHJpbnRmKCIlMTJzICA6ICIsIG0ubmEpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCA2OyBpKyspCiAgICAgICAgcHJpbnRmKCIlM2QgIiwgbS5zdHRzW2ldKTsKICAgIHByaW50ZigiXG4iKTsKfQoKaW50IG1haW4oKSB7CiAgICBzcmFuZCgodW5zaWduZWQ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