哪位高手来帮个忙,C语言从一个int数组里面随机一个数咋写

谁来帮个忙,C语言从一个int数组里面随机一个数咋写我知道python的很简单random.choice(list)[解决办法]C/C

谁来帮个忙,C语言从一个int数组里面随机一个数咋写
我知道
python的很简单
random.choice(list)


[解决办法]

C/C++ code
int i = 0;srandom(seed);//设一个随机种子i = list[random()%n]; // n = 数组长度
[解决办法]
c++ 也很简单!

C/C++ code
#include <iostream>#include <Windows.h>using namespace std;int main(){    int a[]={1,2,3,4,5};    cout<<a[GetTickCount()%sizeof(a)/sizeof(a[0])];    return 0;}