在0~99中取出 NUM 个 随机数 ,最关键的是NUM 怎么实现,我写的编译成功,可看不到结果,肯定不对~~~~
#include<stdlib.h>
#include<stdio.h>
int main (void)
{ int i;
int num;
printf("***** this is program for randoming! *****\n");
printf ("How many nums do you want:"); // 我想取NUM 个数,肯定不对~~
scanf ("%d",num) ;
printf("num random numbers from 0 to 99:\n");
for(i=0;i<num;i++)
printf ("%d\n",rand()%100);
return 0;
getch();
}
[此贴子已经被作者于2006-10-17 19:46:23编辑过]