求助啊,坛子和高手,给我讲一下这个程序的过程,要求详细点
/*这是一个输入数据产出随机数据的程序,主要用来演示变量的属性设置*/
#include"stdio.h"
#define N 10
static unsigned long k=-1;
void unsigned startnum(unsigned int seed)
{
k=seed;
}
unsigned randnum(long n)
{
k=((k*159+23)%n)+1;
return k;
}
main()
{
register unsigned int i;
long n=0;
while(!(n>0&&(k>0&&k<=65536)))
{
printf("\n input the seek and the max random [1-65535]:\n");
scanf("%1d%1d",&k,&n);
if(n<=0)
printf("\n wrong seek!");
if(k<=0||k>65536)
printf("\n wrong max random");
}
startnum(n);
for(i=0;i<N;i++)
printf("%6u",randnum(n));
return;
}