#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
int n;
int count;
for(count=1;count>0;)
{
i=rand()%100;
printf("第%d个随机数为:%d\n", count, i);
count++;
if ((i >= 70) && (i <= 100))
{
for (n = 2; n <= i; n++)
{
if (i % n == 0)
{
if (n < i) {
printf("%d不是质数\n", i);
break;
}
else
{
printf("%d符合要求\n", i);
count = 0;
break;
}
}
}
}
else
{
printf("%d范围不符合\n", i);
}
}
system("pause");
}