C 产生随机码

 

#include<stdio.h>
#include<malloc.h>
#include<conio.h>
#include<stdlib.h>
#include "math.h"
#include"time.h"
#define NULL 0

 

 

 

main()

{

 

float a;
srand(123456); //产生随机码的种子
printf("Random numbers are: %i %i\n",rand(),rand()); // 产生伪随机码
return 0;
}

posted @ 2016-03-11 16:13  ocean2015  阅读(139)  评论(0编辑  收藏  举报