#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int i, arr[100];
// arr前82個數字填0,後18個填1
for (i = 0; i < 82; i++)
arr[i] = 0;
for (i = 82; i < 100; i++)
arr[i] = 1;
// 取50次
for (i = 0; i < 50; i++)
{
// 從arr裡面任取一個
// 如果是0就是得到10
// 如果是1就得到11~20之一
if (arr
[rand() % 100] == 0) else
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCmludCBtYWluKCkKewogICAgaW50IGksIGFyclsxMDBdOwogICAgc3JhbmQodGltZShOVUxMKSk7CgogICAgLy8gYXJy5YmNODLlgIvmlbjlrZfloasw77yM5b6MMTjlgIvloasxCiAgICBmb3IgKGkgPSAwOyBpIDwgODI7IGkrKykKICAgICAgICBhcnJbaV0gPSAwOwogICAgZm9yIChpID0gODI7IGkgPCAxMDA7IGkrKykKICAgICAgICBhcnJbaV0gPSAxOwoKICAgIC8vIOWPljUw5qyhCiAgICBmb3IgKGkgPSAwOyBpIDwgNTA7IGkrKykKICAgIHsKICAgICAgICAvLyDlvp5hcnLoo6HpnaLku7vlj5bkuIDlgIsKICAgICAgICAvLyDlpoLmnpzmmK8w5bCx5piv5b6X5YiwMTAKICAgICAgICAvLyDlpoLmnpzmmK8x5bCx5b6X5YiwMTF+MjDkuYvkuIAKICAgICAgICBpZiAoYXJyW3JhbmQoKSAlIDEwMF0gPT0gMCkKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLCAxMCk7CiAgICAgICAgZWxzZQogICAgICAgICAgICBwcmludGYoIiVkICIsIHJhbmQoKSAlIDEwICsgMTEpOwogICAgfQp9Cg==