#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define NUM_TRIALS 10  // 10번 뽑기
#define FOUR_STAR_THRESHOLD 10  // 10번 뽑을 때마다 4성 캐릭터 획득
#define FIVE_STAR_PROBABILITY 0.05  // 5성 캐릭터 확률 0.05%
#define FIVE_STAR_PICKUP_PROBABILITY 0.5  // 천장에서 5성 픽업 캐릭터 확률 50%
#define NUM_FOUR_STAR_CHARS 3  // 4성 캐릭터 개수
#define NUM_FIVE_STAR_CHARS 8  // 5성 캐릭터 개수

// 캐릭터 클래스
typedef enum {
   THREE_STAR,
   FOUR_STAR,
   FIVE_STAR_PICKUP,
   FIVE_STAR_PERMANENT
} CharacterClass;

// 캐릭터 정보
typedef struct {
const char* name;
   CharacterClass class;
} Character;

// 캐릭터 목록 (3성은 생략)
Character characters[] = {
{"Character A", FOUR_STAR},
{"Character B", FOUR_STAR},
{"Character C", FOUR_STAR},
{"Character D", FIVE_STAR_PICKUP},
{"Character E", FIVE_STAR_PICKUP},
{"Character F", FIVE_STAR_PICKUP},
{"Character G", FIVE_STAR_PICKUP},
{"Character H", FIVE_STAR_PICKUP},
{"Character I", FIVE_STAR_PICKUP},
{"Character J", FIVE_STAR_PICKUP},
{"Character K", FIVE_STAR_PERMANENT},
{"Character L", FIVE_STAR_PERMANENT},
{"Character M", FIVE_STAR_PERMANENT},
{"Character N", FIVE_STAR_PERMANENT},
{"Character O", FIVE_STAR_PERMANENT},
{"Character P", FIVE_STAR_PERMANENT},
{"Character Q", FIVE_STAR_PERMANENT},
{"Character R", FIVE_STAR_PERMANENT}
};

// 캐릭터 뽑기 함수
Character* draw() {
double probability = ((double) rand() / RAND_MAX) * 100;  // 0~100 범위 랜덤 실수
 if (probability < FIVE_STAR_PROBABILITY) {
double pickup_probability = ((double) rand() / RAND_MAX);
 if (pickup_probability < FIVE_STAR_PICKUP_PROBABILITY) {
return &characters[3 + rand() % 8];  // 5성 픽업 캐릭터 랜덤 선택
else {
return &characters[11 + rand() % 7];  // 5성 상시 캐릭터 랜덤 선택
       }
else {
 if ((rand() % FOUR_STAR_THRESHOLD) == 0) {
return &characters[rand() % NUM_FOUR_STAR_CHARS];  // 4성 캐릭터 랜덤 선택
else {
return &characters[0];  // 3성 캐릭터 (Character A) 반환
       }
   }
}

int main() {
srand(time(NULL)); // 랜덤 시
int num_trials = 0;
int num_fives = 0;
int num_pickup_fives = 0;
int num_permanent_fives = 0;
int num_fours = 0;
int num_threes = 0;

printf("Start drawing!\n");

while (num_trials < NUM_TRIALS) {
   Character* result = draw();
printf("You got %s!\n", result->name);
 switch (result->class) {
 case FIVE_STAR_PICKUP:
           num_fives++;
           num_pickup_fives++;
 break;
 case FIVE_STAR_PERMANENT:
           num_fives++;
           num_permanent_fives++;
 break;
 case FOUR_STAR:
           num_fours++;
 break;
 case THREE_STAR:
           num_threes++;
 break;
   }
   num_trials++;
 if (num_trials % 10 == 0) {
printf("You have drawn %d times.\n", num_trials);
printf("You got %d 5-star characters (%d pickup, %d permanent), %d 4-star characters, and %d 3-star characters.\n",
              num_fives, num_pickup_fives, num_permanent_fives, num_fours, num_threes);
printf("You have a %d%% chance of getting a 5-star character on your next draw.\n",
(int) (FIVE_STAR_PROBABILITY * 100));
printf("You will definitely get a 5-star pickup character on your next draw.\n");
       num_pickup_fives++;
   }
}

printf("You have finished drawing %d times.\n", num_trials);
printf("You got %d 5-star characters (%d pickup, %d permanent), %d 4-star characters, and %d 3-star characters.\n",
      num_fives, num_pickup_fives, num_permanent_fives, num_fours, num_threes);
printf("Thank you for playing!\n");

return 0;

gpt가 조져놨는데 오류가 났서요