c语言求大佬帮看看,最后三个tle
#include <stdio.h>
int any(int a)
{
int k;
if (a == 1)
{
return 0;
}
if (a % 2 == 0)
{
return 0;
}
for (int j = 2; j < a - 1 && j <= 9989899; j++)
{
if (a % j == 0)
{
k = 0;
break;
}
else
{
k = 1;
}
}
if (k == 1)
{
printf("%d\n", a);
}
}
int some(int a)
{
int c = a, b = 0;
while (c)
{
b *= 10;
b += c % 10;
c = c / 10;
}
return b == a;
}
int i, n, start;
int main()
{
scanf("%d %d", &start, &n);
for (i = start; i <= n; i++)
{
if (some(i))
{
any(i);
}
}
return 0;
}