Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
31
Task/Roman-numerals-Encode/Refal/roman-numerals-encode.refal
Normal file
31
Task/Roman-numerals-Encode/Refal/roman-numerals-encode.refal
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
$ENTRY Go {
|
||||
= <Show 1666>
|
||||
<Show 2008>
|
||||
<Show 1001>
|
||||
<Show 1999>
|
||||
<Show 3888>
|
||||
<Show 2025>;
|
||||
};
|
||||
|
||||
Show {
|
||||
s.N = <Prout <Symb s.N> ' = ' <Roman s.N>>;
|
||||
};
|
||||
|
||||
Roman {
|
||||
0 = ;
|
||||
s.N, <RomanStep s.N>: s.Next e.Part = e.Part <Roman s.Next>;
|
||||
};
|
||||
|
||||
RomanStep {
|
||||
s.N = <RomanStep s.N <RomanDigits>>;
|
||||
s.N (s.Size e.Part) e.Parts, <Compare s.N <Sub s.Size 1>>: '+' =
|
||||
<Sub s.N s.Size> e.Part;
|
||||
s.N t.Part e.Parts = <RomanStep s.N e.Parts>;
|
||||
};
|
||||
|
||||
RomanDigits {
|
||||
= (1000 'M')
|
||||
( 900 'CM') ( 500 'D') ( 400 'CD') ( 100 'C')
|
||||
( 90 'XC') ( 50 'L') ( 40 'XL') ( 10 'X')
|
||||
( 9 'IX') ( 5 'V') ( 4 'IV') ( 1 'I');
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue