方法二:直接把ran放到main前
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int ran(int x)
{
srand(time(0));
x=rand()% 100;
return x;
}
int main()
{
int a;
printf("%d",ran(a));
return 0;
}
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int ran(int x)
{
srand(time(0));
x=rand()% 100;
return x;
}
int main()
{
int a;
printf("%d",ran(a));
return 0;
}