#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
int hold_power_3_persen1 = 1;
int hold_power_3_persen2 = 10;
int hold_power_3_persen3 = 30;
int hold_power_3_persen4 = 59;
int values[] = {hold_power_3_persen1, hold_power_3_persen2, hold_power_3_persen3, hold_power_3_persen4};
// สุ่ม index ของอาเรย์
int randomIndex
= rand() % (sizeof(values
) / sizeof(values
[0]));
// แสดงค่าที่สุ่มได้
printf("Random Value: %d\n", values
[randomIndex
]);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCmludCBtYWluKCkgewoKICAgIGludCBob2xkX3Bvd2VyXzNfcGVyc2VuMSA9IDE7CiAgICBpbnQgaG9sZF9wb3dlcl8zX3BlcnNlbjIgPSAxMDsKICAgIGludCBob2xkX3Bvd2VyXzNfcGVyc2VuMyA9IDMwOwogICAgaW50IGhvbGRfcG93ZXJfM19wZXJzZW40ID0gNTk7CgogICAgaW50IHZhbHVlc1tdID0ge2hvbGRfcG93ZXJfM19wZXJzZW4xLCBob2xkX3Bvd2VyXzNfcGVyc2VuMiwgaG9sZF9wb3dlcl8zX3BlcnNlbjMsIGhvbGRfcG93ZXJfM19wZXJzZW40fTsKCiAgICBzcmFuZCh0aW1lKE5VTEwpKTsKCiAgICAvLyDguKrguLjguYjguKEgaW5kZXgg4LiC4Lit4LiH4Lit4Liy4LmA4Lij4Lii4LmMCiAgICBpbnQgcmFuZG9tSW5kZXggPSByYW5kKCkgJSAoc2l6ZW9mKHZhbHVlcykgLyBzaXplb2YodmFsdWVzWzBdKSk7CgogICAgLy8g4LmB4Liq4LiU4LiH4LiE4LmI4Liy4LiX4Li14LmI4Liq4Li44LmI4Lih4LmE4LiU4LmJCiAgICBwcmludGYoIlJhbmRvbSBWYWx1ZTogJWRcbiIsIHZhbHVlc1tyYW5kb21JbmRleF0pOwoKICAgIHJldHVybiAwOwp9Cg==