main中的void.return
给大家一个程序把
#include "stdio.h"
#define N 10
static unsigned startnum(unsigned int seed)
{
k=seed;
}
unsigned randnum(long n)
{ k=((k*159)%n)+1;
return k;
}
main()
{register unsigned int i;
long n=0;
while(!(n>0&&(k>0&&k<=65535)))
{printf("\nInput the seed and the max random[1-65535]:\n");
scanf(%ld%ld,&k,&n);
if (n<=0)
printf("\n wrong number!");
if(k<=0||k>65535)
printf("\n wrong max random!");
}
startnum(n);
for(i=0;i<N;i++)
printf(%6u",randnum(n));
return;
}
没有return会陷入死循环