|
5啊哈币
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int a;
srand((unsigned)time(NULL)*1000);
a=rand()*663455346843%20000000;
printf("%d\n",a);
system("pause");
return 0;
}
请问这样写可以不?我想知道标准答案,不要用太复杂的函数,这一章以内学过的
|
最佳答案
查看完整内容
最高位在0-1之间选数,其他位在0-9之间选数,这样合并起来是0-19999999,再加1就对啦
|