#include
#include
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");
}
你是否還在尋找穩定的海外服務器提供商?創新互聯www.cdcxhl.cn海外機房具備T級流量清洗系統配攻擊溯源,準確流量調度確保服務器高可用性,企業級服務器適合批量采購,新人活動首月15元起,快前往官網查看詳情吧