c++生成随机数

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define random(x) (rand()%x)

void main()
{
     srand((int)time(0));
     for(int x=0;x<10;x++)
           printf("%d/n",random(100));
}

 

posted on 2014-05-27 15:31  13m0n  阅读(149)  评论(0编辑  收藏  举报