::srand((unsigned int)time(NULL)); //先初始化int x=rand(); //随机
解决方案 »
- 打开一个文件夹向列表框中添加文件,怎么实现多选?
- 关于CWnd::Detach()的用法
- vc++错误local function definitions are illegal
- 那位仁兄能给我一份周长发的《精通VC++图像编程》的随书光盘的代码啊 有的请帮忙 谢先!
- 关于MSDN的错误.
- ,有谁知道如何在不打开WORD的情况下怎么把DOC文件送到默认的打印机进行打印???谢谢大家(
- 《WinSock网络编程经络》中Trace Route问题 [来者有分]
- 当我下载文件时的那个有进度显示条的对话框怎么做呀?
- 关于在钩子函数中使用POSTmessage(在线等急)
- 装VS7的时候,出现如下提示~~~
- 请教,如何用代码获取Access数据库中的全部表名.
- 查找
int x=rand()%10; //产生0-9的随机数
#include <stdio.h>
#include <time.h>void main( void )
{
int i; /* Seed the random-number generator with current time so that
* the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) ); /* Display 10 numbers. */
for( i = 0; i < 10;i++ )
printf( " %6d\n", rand() );
}