Ok, premyslej, a jak to delas bez programu? Delal jsi to nekdy? ne? tak si to zkus, papir, tuzku a jedem...
[1,2,3,4,5] rada, vymyslena cisla (rezist. rada ma cisla >=1 do <10, jakesi nasoky, nechce se mi ted premyslet)
[5,4,3,2,1] seradis, nejvyssi prvni
R = 126.7 kOhm ... prevedes na exponent
x = 1.267 | y = 100 (nasobitel, rekneme, ze nechci mene nez kOhm)
x - 5 > 0 ? ne
x - 3 > 0 ? ne
x - 2 > 0 ? ne
x - 1 > 0 ? ano, R[] = 1 * y | x = x - 1 = 0.267
posledni cislo v rade
x = x * 10; y = y/10
x = 2.67 | y = 10
x - 5 > 0 ? ne
x - 3 > 0 ? ne
x - 2 > 0 ? ano, R[] = 2 * y; x = x - 2 = 0.67
x - 1 > 0 ? ne
x = x * 10; y = y/10
x = 6.7 | y = 1
x - 5 > 0 ? ano, R[] = 5 * y; x = x - 5 = 1.7
x - 3 > 0 ? ne
x - 2 > 0 ? ne
x - 1 > 0 ? ano, R[] = 1 * y; x = x - 1 = 0.7
y = y/10
y<1 konec
R = 100 + 20 + 5 + 1 kOhm = 126 kOhm