Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Palindrome-dates/XPL0/palindrome-dates.xpl0
Normal file
28
Task/Palindrome-dates/XPL0/palindrome-dates.xpl0
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
func Rev(N);
|
||||
int N;
|
||||
[N:= N/10;
|
||||
return rem(0)*10 + N;
|
||||
];
|
||||
|
||||
proc NumOut(N);
|
||||
int N;
|
||||
[if N < 10 then ChOut(0, ^0);
|
||||
IntOut(0, N);
|
||||
];
|
||||
|
||||
int C, Y, M, D, Q, R;
|
||||
[C:= 0;
|
||||
for Y:= 2021 to -1>>1 do
|
||||
for M:= 1 to 12 do
|
||||
for D:= 1 to 28 do
|
||||
[Q:= Y/100;
|
||||
R:= rem(0);
|
||||
if Q = Rev(D) and R = Rev(M) then
|
||||
[IntOut(0, Y); ChOut(0, ^-);
|
||||
NumOut(M); ChOut(0, ^-);
|
||||
NumOut(D); CrLf(0);
|
||||
C:= C+1;
|
||||
if C >= 15 then return;
|
||||
];
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue