static 就是静态的
他会被其后面的值给覆盖 给你一个例子
# include < stdio.h>
int ran ()
{
static int see=1234,n;
printf ("v(see=%4d)",see);
see=(see+25543)%7415;
n=(see % 1000)/10;
return (n);
}
int rand ()
{
static int see=1234,n;
printf ("(see=%5d)",see);
see=(see+25543)%7415;
n=(see % 1000)/10;
return (n);
}
void main()
{
int i,j;
for (i=0;i<3;i++)
{
for (j=0;j<2;j++)
printf ("%3d",ran());
printf("\n");
}
for (i=0;i<3;i++)
{
for (j=0;j<2;j++)
printf ("%3d",rand());
printf("\n");
}
}
试试吧
体会一下