这样写绝对没错:
#include "stdio.h"
#include "stdlib.h"
#include <time.h>
main()
{
int a,b;
srand(time(NULL));
a = rand() % 100;
printf("%d\n", a);
scanf("%d", &b);
if(a < b)
printf("up\n");
else
printf("down\n");
}
你没有加#include <time.h>
当然无法使用time()函数啦
#include "stdio.h"
#include "stdlib.h"
#include <time.h>
main()
{
int a,b;
srand(time(NULL));
a = rand() % 100;
printf("%d\n", a);
scanf("%d", &b);
if(a < b)
printf("up\n");
else
printf("down\n");
}
你没有加#include <time.h>
当然无法使用time()函数啦

天之道,损有余而补不足.人之道则不然,损不足以奉有余.孰能有余以奉天下,唯有道者.