c语言之猜数游戏:[1]
1、写入所需头文件#include <stdlib.h>/*随机函数的申明*/#include <stdio.h> #include <time.h>
2、所需变量的定义main(){int n,g,c=100,d=0,t;
3、srand( (unsigned)time( NULL ) );n=rand()%100; /*产生并调用随机数*/
![c语言之猜数游戏:[1]](https://exp-picture.cdn.bcebos.com/2db6c1b2dc19ce2c8112b56a7fdca039121f11a2.jpg)
1、写入所需头文件#include <stdlib.h>/*随机函数的申明*/#include <stdio.h> #include <time.h>
2、所需变量的定义main(){int n,g,c=100,d=0,t;
3、srand( (unsigned)time( NULL ) );n=rand()%100; /*产生并调用随机数*/