dev-c++这个是怎么回事啊!!

来源:百度知道 编辑:UC知道 时间:2024/05/27 12:52:19
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

/* prints a random number in the range 0 to 99 */
int main(void)
{
randomize();
printf("Random number in the 0-99 range: %d\n", random (100));
return 0;
}

可能DEV的这几个库里没有这个函数吧
试试这个程序,一样的功能
#include "stdio.h"
#include "stdlib.h"
#include "time.h"

int main()
{
int i;
srand(time(0));
printf("Ten random numbers from 0 to 99\n\n");
for(i=0; i<10; i++)
printf("%d\n", rand() % 100);
return 0;
}
srand()函数应该也是你要的
也许有帮助

随机函数使用错误,随机函数不能那么用,劝你去百度搜一下随机函数用法

你写的是什么语言呢 c?
Main函数都写错了把

时间种子要用
srand(time(NULL));//程序的开始用一次
然后再
rand();