生成随机数

#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的数

你可能感兴趣的:(随机数)