JavDev,
100 - 78
проход по массиву max = [0,0,1] , min = [8,7], c = 0
1 шаг
b = 0 - (8 || 0) + 0;
b = -8
b < 0 result[i] = 10 + -8 = 2 , c = -1
result = [2]
2 шаг
b = 0 - (7 || 0) + -1;
b = -8
b < 0 result[i] = 10 + -8 = 2 , c = -1
result = [2,2]
3 шаг
b = 1 - (null|| 0) + -1;
b = 0
b == 0 result[i] = 0, c = 0
result = [2,2,0]
result.reverse() ...
result = "22"
100 - 78 = 22
алгоритм умножения не знаю
|