c语言 编写一个程序,程序中使用随机函数产生一个0~9之间的数。急!!!!

日期:2014-01-03 05:49:49 人气:1

c语言 编写一个程序,程序中使用随机函数产生一个0~9之间的数。急!!!!

//#include "stdafx.h"//vc++6.0加上这一行. #include "stdio.h" #include "time.h" #include "stdlib.h" void main(void){ srand((unsigned)time(NULL)); printf("%d\n",rand()%10); }
    A+
热门评论