2 puts "Rovnica ma tvar: a1 * x + b1 * y1 = c1"
\r
3 puts " a2 * x + b2 * y1 = c2"
\r
6 print "Zadaj cislo a1: "
\r
8 print "Zadaj cislo b1: "
\r
10 print "Zadaj cislo c1: "
\r
12 print "Zadaj cislo a2: "
\r
14 print "Zadaj cislo b2: "
\r
16 print "Zadaj cislo c2: "
\r
27 ########### 1 riesenie 1 ##############
\r
34 l1=(a1*((-1)*a2)*x1)+(b1*((-1)*a2)*y1)
\r
37 l2=a2*a1*x2+b2*a1*y2
\r
40 l1=(b1*(a2*(-1)))+(b2*a1).to_i
\r
41 p1=(c1*(a2*(-1)))+(c2*a1).to_i
\r
45 xv1=(c1-b1*yv1)/a1.to_i
\r
48 puts " 1. ["+xv1.to_s+","+yv1.to_s+"]"
\r
50 ########### 2 riesenie 2 ##############
\r
57 l1=(a1*((-1)*a2)*x1)+(b1*((-1)*a2)*y1)
\r
60 l2=a2*a1*x2+b2*a1*y2
\r
63 l1=(b1*(a2*(-1)))+(b2*a1).to_f
\r
64 p1=(c1*(a2*(-1)))+(c2*a1).to_f
\r
68 xv2=(c1-b1*yv2)/a1.to_f
\r
71 puts " 2. ["+xv2.to_s+","+yv2.to_s+"]"
\r