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