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

谁来帮个忙,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;
}