Home > Back-end >  For 100 to 999 super reverse primes, answer to 39, 57, I calculate really don't know where is w
For 100 to 999 super reverse primes, answer to 39, 57, I calculate really don't know where is w

Time:09-30

#include
#include
#include
Int sushu (int);
Int main ()
{
int i=0;
Int nCount=0;
Int ni=0;
For (I=100; i <=999; I + +)

{

If (sushu (I))
{
Int a=I/10% 10;
Int b=I % 10;
Ni=a * 10 + b;
If (sushu (ni) & amp; & a !=0 & amp; & B!=0)
{
Int c=I % 10;
If (sushu (c))
{
NCount + +;
}
}
}
}
Printf (" % d ", nCount);
System (" pause ");
return 0;
}
Int sushu (int I)
{
int n=0;
For (n=2; N & lt;=SQRT (I); N + +)
{
If (I % n==0)
return 0;
}
return 1;
}

CodePudding user response:

Hexadecimal 39 is equal to a decimal 57

CodePudding user response:

reference 1st floor gouyanfen response:
hexadecimal 39 is equal to a decimal 57

But I am in accordance with the decimal promised

CodePudding user response:

 # include & lt; stdio.h> 
#include
#include

Int sushu (int);
Int main ()
{
int i=0;
Int nCount=0;
Int ni=0, num;
For (I=100; i <=999; I + +) {
Num=I;
If (sushu (num) & amp; & Num % 100 & gt; 10 & amp; & Sushu (num % 100) & amp; & Sushu (10) num %) {
NCount++;
Printf (" % d \ t ", num);
}
/*
If (sushu (I))
{
Int a=I/10% 10;
Int b=I % 10;
Ni=a * 10 + b;
If (sushu (ni) & amp; & a !=0 & amp; & B!=0)
{
Int c=I % 10;
If (sushu (c))
{
NCount + +;
}
}
}
*/
}
Printf (" + + % d ", nCount);
System (" pause ");
return 0;
}

Int sushu (int n)
{
int i=0;
If (n & lt; 2)
return 0;
For (I=2; i <=SQRT (n); I++)
{
If I (n %==0)
return 0;
}
return 1;
}
/*
Int sushu (int I)
{
int n=0;
For (n=2; N & lt;=SQRT (I); N + +)
{
If (I % n==0)
return 0;
}
return 1;
}
*/


For your reference ~

Prime judgment logic is a little question, if I is 1, then also considered a prime number,