64,637
社区成员
发帖
与我相关
我的任务
分享
/*************************************************************************
> File Name: rand.c
> Author: Jukay
> Created Time: 2014年10月09日 星期四 16时42分25秒
************************************************************************/
#include<stdio.h>
#include<stdlib.h>
int main()
{
time_t t;
int a;
float b;
int i=0;
srand((unsigned)time(&t));
for(;i < 1000; i++)
{
a = 90 + rand()%10 ;
//printf("%d\t",a);
b = a / 100.0;
printf("%3.2f\t\n",b);
}
exit(0);
}/*0.92
0.93
0.97
0.95
0.95
0.91
0.95
0.98
0.95
0.94
0.99
0.97
0.93
0.94
0.97
0.94
0.99*/