Вот такая sub функция на golang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
func Sub(n int, m int) { var s string = "B" if n > 0 { s += "X" } for i := 0; i < n; i++ { s += "0" } s += "1" if m < 0 { s += "Y" m *= -1 } else if m > 0 { s += "X" } for i := 0; i < m; i++ { s += "0" } s += "B" q0(s, 1) } |