/* Integer division by long-division method */ const dw = 16; void main(chan (in) STDIN : dw, chan (out) STDOUT : dw) { int a, b, c : dw; int bits : 5; while (1) { STDIN ? a; STDIN ? b; c, bits = 0, 1; while (b .<=. a) b, bits = b << 1, bits + 1; do par { if (a .>=. b) a, c = a - b, (c << 1) ^ 1; else c = c << 1; b, bits = b >> 1, bits - 1; } while (bits != 0); STDOUT ! c; } }