#include
Int sushu b (int);
C int huiwen (int);
Int main ()
{int a;
For (a=100; a<1000; +)
{if (sushu (a) & amp; & Huiwen (a))
Printf (" % d \ n ", a);
}
return 0;
}
Int sushu (int b)
{int e, f;
E=SQRT (b);
For (f=2; F<=e; F++)
If (b % f==0)
return 0;
}
Int huiwen (int) c
{int g, h;
G=c/100;
H=c % 10;
If (g==h)
return 1;
return 0;
}
#include
#include
Int sushu b (int);
C int huiwen (int);
Int main ()
{int a;
For (a=100; a<1000; +)
{if (sushu (a) & amp; & Huiwen (a))
Printf (" % d \ n ", a);
}
return 0;
}
Int sushu (int b)
{int e, f;
E=SQRT (b);
For (f=2; F<=e; F++)
If (b % f!=0)
return 1;
}
Int huiwen (int) c
{int g, h;
G=c/100;
H=c % 10;
If (g==h)
return 1;
return 0;
}
CodePudding user response:
Both wrong ah, verify prime function must to return 0 and return 1? So just logical,CodePudding user response:
Modify the first, for reference:# include
#include
Int sushu b (int);
C int huiwen (int);
Int main ()
{
int a;
For (a=100; a<1000; +)
{
If (sushu (a) & amp; & Huiwen (a))
Printf (" % d \ n ", a);
}
return 0;
}
Int sushu (int b)
{
Int e, f;
E=SQRT (b);
For (f=2; F<=e; F++)
If (b % f==0) return 0;
return 1;
}
Int huiwen (int) c
{
Int g, h;
G=c/100;
H=c % 10;
If (g==h)
return 1;
return 0;
}
CodePudding user response: