希望更丰富的展现?使用Markdown
by t162 @ 2019-03-27 17:54:02
希望更丰富的展现?使用Markdown
by HYSK_残雪 @ 2019-03-27 18:22:01
```
include <stdio.h>
include <math.h>
int isprime(int n) {
int i;
for(i=2;i<=sqrt(n);i++)
if(n%i==0)
return 0;
return 1;
}
int first(int n,double d) {
while(n>=pow(10,d))
n=n/10;
n=n%10;
return n;
} int last(int n,double d) {
n=n%((int)pow(10,d));
n=n/pow(10,d-1);
return n;
}
int ifhuiwen(int h) {
int i,j=1;
for(int d=1;d<=sqrt(10000000);d++)
{
if(h<pow(10,d))
break;
else if(first(h,d)!=last(h,d)){
j--;
break;}
}
return j;
}
int main(void)
{
int a,b,i;
scanf("%d%d",&a,&b);
for(i=a;i<=b;i++)
if(isprime(i)&&ifhuiwen(i))
printf("%d\n",i);
return 0;
}
```
by HYSK_残雪 @ 2019-03-27 18:22:28
一位p党表示看不懂...
by TCZN @ 2019-03-27 18:24:52
# ސޮސ
by laohu @ 2019-03-30 20:24:36
ސދދހެުފހ ްއދހ3ިދހުެދޔހދ
by laohu @ 2019-03-30 20:24:44
@[HYSK_残雪](/space/show?uid=65671) 太慢了
by chen_zhe没鸡鸡 @ 2019-07-15 08:54:02
@[缪性](/space/show?uid=216578) ?隔了四个月回复什么操作。而且我发的就是你的程序
by HYSK_残雪 @ 2019-07-15 09:24:49
@[HYSK_残雪](/space/show?uid=65671) ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
by chen_zhe没鸡鸡 @ 2019-07-15 09:33:09
@[HYSK_残雪](/space/show?uid=65671) 不一样吧,测试了你的发现应该过不了
by chen_zhe没鸡鸡 @ 2019-07-15 09:33:49