生成随机数

#include <stdlib.h> 
#include <iostream.h> 
#include <time.h>

void main(){

    srand( (unsigned)time( NULL ) ); 

    for(int i=0;i<100000;i++){ 

        cout<<rand()<<endl; 
    }

} 
//rand()*x表示生成0-x的数
posted @ 2014-11-15 21:26  jamsbwo  阅读(108)  评论(0编辑  收藏  举报
©2014 to