Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Babbage-problem/XPL0/babbage-problem.xpl0
Normal file
22
Task/Babbage-problem/XPL0/babbage-problem.xpl0
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
int N, C, R;
|
||||
[C:= 0;
|
||||
for N:= sqrt(269696) to -1>>1 do \to infinity (2^31-1)
|
||||
if rem(N/10)=4 or rem(N/10)=6 then \must end 6: 4^2=16; 6^2=36
|
||||
[R:= rem(N/100);
|
||||
if R=14 or R=36 or R=64 or R=86 then \14^2=196, etc.
|
||||
[R:= rem(N/1000);
|
||||
if R=236 or R=264 or R=736 or R=764 then \236^2=55696, etc.
|
||||
[C:= C+1; \count remaining tests
|
||||
if rem(N*N/1_000_000) = 269_696 then
|
||||
[IntOut(0, N);
|
||||
Text(0, "^^2 = ");
|
||||
IntOut(0, N*N);
|
||||
CrLf(0);
|
||||
IntOut(0, C);
|
||||
CrLf(0);
|
||||
exit;
|
||||
];
|
||||
];
|
||||
];
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue