新手,帮忙找下错!!!
#include "stdio.h"#include "stdlib.h"
#include "time.h"
#include "math.h"
int f1(int x);
main()
{int x,i;
stand(time(NULL));
for(i=1;i<=50;i++)
{x=rand()%201+300;
if(f1(x))
{printf("%7d*",x);
}
else{printf("%d",x);
}
}
int f1(int x)
{int a=2;
for(a=2;a<=(int)sqrt(x);a++)
{if(x%a==0)
{return 0;
}
}
return 1;
}