Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
40
Task/Eban-numbers/XPL0/eban-numbers.xpl0
Normal file
40
Task/Eban-numbers/XPL0/eban-numbers.xpl0
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
include xpllib; \for Print
|
||||
|
||||
int Rgs, Rg, Count, I, B, R, M, T;
|
||||
[Rgs:= [
|
||||
[2, 1000, true],
|
||||
[1000, 4000, true],
|
||||
[2, 10000, false],
|
||||
[2, 100000, false],
|
||||
[2, 1000000, false],
|
||||
[2, 10000000, false],
|
||||
[2, 100000000, false],
|
||||
[2, 1000000000, false] ];
|
||||
for Rg:= 0 to 8-1 do
|
||||
[if Rgs(Rg,0) = 2 then
|
||||
Print("eban numbers up to and including %d\n", Rgs(Rg,1))
|
||||
else
|
||||
Print("eban numbers between %d and %d (inclusive):\n", Rgs(Rg,0), Rgs(Rg,1));
|
||||
Count:= 0;
|
||||
I:= Rgs(Rg,0);
|
||||
while I <= Rgs(Rg,1) do
|
||||
[B:= (I/1_000_000_000);
|
||||
M:= rem(0) / 1_000_000;
|
||||
T:= rem(0) / 1_000;
|
||||
R:= rem(0);
|
||||
if M >= 30 and M <= 66 then M:= rem(M/10);
|
||||
if T >= 30 and T <= 66 then T:= rem(T/10);
|
||||
if R >= 30 and R <= 66 then R:= rem(R/10);
|
||||
if B = 0 or B = 2 or B = 4 or B = 6 then
|
||||
if M = 0 or M = 2 or M = 4 or M = 6 then
|
||||
if T = 0 or T = 2 or T = 4 or T = 6 then
|
||||
if R = 0 or R = 2 or R = 4 or R = 6 then
|
||||
[if Rgs(Rg,2) then Print("%d ", I);
|
||||
Count:= Count+1;
|
||||
];
|
||||
I:= I+2;
|
||||
];
|
||||
if Rgs(Rg,2) then CrLf(0);
|
||||
Print("count = %d\n", Count);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue