#!/usr/bin/ruby
var a = 71;
var b = 43;
var x = a.to_s.split('').map{.to_i}.reverse;
var y = b.to_s.split('').map{.to_i}.reverse;
var n = [
(((((x[0] * y[0])) % 10)) % 10),
(((((x[1] * y[0]) + int(((x[0] * y[0])) / 10)) % 10) + (((x[0] * y[1])) % 10) + int(((((x[0] * y[0])) % 10)) / 10)) % 10),
((int(((x[1] * y[0]) + int(((x[0] * y[0])) / 10)) / 10) + (((x[1] * y[1]) + int(((x[0] * y[1])) / 10)) % 10) + int(((((x[1] * y[0]) + int(((x[0] * y[0])) / 10)) % 10) + (((x[0] * y[1])) % 10) + int(((((x[0] * y[0])) % 10)) / 10)) / 10)) % 10),
(int(((x[1] * y[1]) + int(((x[0] * y[1])) / 10)) / 10) + int((int(((x[1] * y[0]) + int(((x[0] * y[0])) / 10)) / 10) + (((x[1] * y[1]) + int(((x[0] * y[1])) / 10)) % 10) + int(((((x[1] * y[0]) + int(((x[0] * y[0])) / 10)) % 10) + (((x[0] * y[1])) % 10) + int(((((x[0] * y[0])) % 10)) / 10)) / 10)) / 10)),
].join.reverse.to_i;
n == (a * b) || die "error!";
say "** Test passed!";