Primes whose first and last number is 3: Difference between revisions
Primes whose first and last number is 3 (view source)
Revision as of 14:55, 24 July 2021
, 2 years ago→{{header|XPL0}}: Revised for stretch goal.
(→{{header|XPL0}}: Revised for stretch goal.) |
|||
Line 343:
];
func
int N;
[repeat N:= N/10;
until N = 0;
while N do N:= N/10;▼
return rem(0) = 3;
];
Line 353 ⟶ 352:
int Count, N;
[Count:= 0;
N:= 3;
[Count:= Count+1;
if rem(Count/10) = 0 then CrLf(0) else ChOut(0, 9\tab\);
];
];
if N = 4003 then
[CrLf(0);
IntOut(0, Count);
Text(0, " such primes found below 4000.");
];
until N >= 1_000_000;
CrLf(0);
IntOut(0, Count);
Text(0, " such primes found below
");
]</lang>
Line 372 ⟶ 381:
3863 3923 3943
33 such primes found below 4000.
2251 such primes found below 1,000,000.
</pre>
|