Anonymous user
Truncatable primes: Difference between revisions
m
→{{header|Elena}}
(Added C++ solution) |
|||
Line 985:
=={{header|Elena}}==
ELENA
<lang elena>import
const MAXN = 1000000;
Line 999 ⟶ 998:
if (n < 2) { ^ false };
if (n < 4) { ^ true };
if (n
if (n < 9) { ^ true };
if (n
int r := n.sqrt();
Line 1,052 ⟶ 1,051:
}
public program()
{
var n := MAXN;
Line 1,078 ⟶ 1,077:
console.printLine("Largest truncable left is ",max_lt);
console.printLine("Largest truncable right is ",max_rt);
console.readChar()
}</lang>
{{out}}
|