請各位大大幫忙~
#include<stdio.h>
main()
{
int a,b,c;
int d = 0;
while(scanf("%d",&a)!=EOF)
{
if(a>=2 && a<=2147483647)
{
for(b=1;b<=a;b++)
{
c = a%b;
if(c==0)
d = d+1;
}
if(d>2)
printf("\n非質數\n\n");
else
printf("\n質數\n\n");
d = 0;
}
}
return 0;
}
顯示如下
TLE (1s)
執行逾時
Killed
請各位大大幫忙~
#include
main()
{
int a,b,c;
int d = 0;
while(scanf("%d",&a)!=EOF)
{
if(a>=2 && a<=2147483647)
{
for(b=1;b<=a;b++)
{
c = a%b;
if(c==0)
d = d+1;
}
if(d>2)
printf("\n非質數\n\n");
else
printf("\n質數\n\n");
d = 0;
}
}
return 0;
}
顯示如下
TLE (1s)
執行逾時
Killed
請各位大大幫忙~
#include
main()
{
int a,b,c;
int d = 0;
while(scanf("%d",&a)!=EOF)
{
if(a>=2 && a<=2147483647)
{
for(b=1;b<=a;b++)
{
c = a%b;
if(c==0)
d = d+1;
}
if(d>2)
printf("\n非質數\n\n");
else
printf("\n質數\n\n");
d = 0;
}
}
return 0;
}
顯示如下
TLE (1s)
執行逾時
Killed
沒break掉會跑到天荒地老喔
請各位大大幫忙~
#include
main()
{
int a,b,c;
int d = 0;
while(scanf("%d",&a)!=EOF)
{
if(a>=2 && a<=2147483647)
{
for(b=1;b<=a;b++)
{
c = a%b;
if(c==0)
d = d+1;
}
if(d>2)
printf("\n非質數\n\n");
else
printf("\n質數\n\n");
d = 0;
}
}
return 0;
}
顯示如下
TLE (1s)
執行逾時
Killed
沒break掉會跑到天荒地老喔
請各位大大幫忙~
#include
main()
{
int a,b,c;
int d = 0;
while(scanf("%d",&a)!=EOF)
{
if(a>=2 && a<=2147483647)
{
for(b=1;b<=a;b++)
{
c = a%b;
if(c==0)
d = d+1;
}
if(d>2)
printf("\n非質數\n\n");
else
printf("\n質數\n\n");
d = 0;
}
}
return 0;
}
顯示如下
TLE (1s)
執行逾時
Killed