euclid.dsc

来自「The program simulates a Nondeterministic」· DSC 代码 · 共 22 行

DSC
22
字号
An Euclid algorithm

Source : 
* B.A.Trakhtenbrot, "Algorithms and computational automata" (in Russian), Novosibirsk, "Sovetskoe Radio", 1974
        

A number 'n' is represented by n 1-s.
Sample :
  5 is represented as  1 1 1 1 1
  3 is represented as  1 1 1


Input  : numbers n1 and n2 without delimeters; the machine head points at last 1-symbol of n1.
Output : the greatest common of n1 and n2


Sample (n1 = 4, n2 = 6) :
Input  : 1 1 1 [1] 1 1 1 1 1 1
Output : 1 1


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?