Old Russian measure of length: Difference between revisions

From Rosetta Code
Content added Content deleted
(New task.)
 
(+ МК-61/52)
Line 3: Line 3:


Is an example of the transformation of several variables that are linearly. The program accepts a single value in the selected unit, and return it in the rest: ''vershoks'', ''arshins'', ''sazhens'', ''versts'', ''meters'', ''centimeters'' and ''kilometers''.
Is an example of the transformation of several variables that are linearly. The program accepts a single value in the selected unit, and return it in the rest: ''vershoks'', ''arshins'', ''sazhens'', ''versts'', ''meters'', ''centimeters'' and ''kilometers''.

=={{header|МК-61/52}}==
<lang>П7 1 0 0 * П8 1 ВП 5 /
П9 ИП7 1 0 6 7 / П0 5 0
0 * ПC 3 * ПA 1 6 * ПB
С/П ПB 1 6 / ПA 3 / ПC 5
0 0 / П0 1 0 6 7 / БП
00</lang>

''Instruction:''
l, meters = РX В/О С/П; l, vershoks = БП 3 1 С/П; l, arshins = РX БП 3 5 С/П; l, sazhens = РX БП 3 8 С/П; l, versts = РX БП 4 3 С/П; РX = РB = l, vershoks; РA = l, arshins; РB = l, versts; РC = l, sazhens; Р7 = l, meters; Р8 = l, centimeters; Р9 = l, kilometers.

Revision as of 16:05, 9 January 2013

Task
Old Russian measure of length
You are encouraged to solve this task according to the task description, using any language you may know.

The program should make the conversion of the old Russian measures of length in the metric and vice versa.

Is an example of the transformation of several variables that are linearly. The program accepts a single value in the selected unit, and return it in the rest: vershoks, arshins, sazhens, versts, meters, centimeters and kilometers.

МК-61/52

<lang>П7 1 0 0 * П8 1 ВП 5 / П9 ИП7 1 0 6 7 / П0 5 0 0 * ПC 3 * ПA 1 6 * ПB С/П ПB 1 6 / ПA 3 / ПC 5 0 0 / П0 1 0 6 7 / БП 00</lang>

Instruction: l, meters = РX В/О С/П; l, vershoks = БП 3 1 С/П; l, arshins = РX БП 3 5 С/П; l, sazhens = РX БП 3 8 С/П; l, versts = РX БП 4 3 С/П; РX = РB = l, vershoks; РA = l, arshins; РB = l, versts; РC = l, sazhens; Р7 = l, meters; Р8 = l, centimeters; Р9 = l, kilometers.