Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gausas :
- Say "Skaiciujame lygciu sistema (2x2) "Zordano Gauso" budu"
- x11=
- x12=
- x21=
- x22=
- laisv1=
- laisv2=
- say "Iveskite skaiciu esanti prie X1 pirmoje lygtyje"
- pull x11
- say "Iveskite skaiciu esanti prie X2 pirmoje lygtyje"
- pull x12
- say "Iveskite laisvaji nari esanti pirmoje lygtyje"
- pull laisv1
- say "Iveskite skaiciu esanti prie X1 antroje lygtyje"
- pull x21
- say "Iveskite skaiciu esanti prie X2 antroje lygtyje"
- pull x22
- say "Iveskite laisvaji nari esanti antroje lygtyje"
- pull laisv2
- select
- when x21>0
- then
- signal kaisveikas
- when x21<0
- then
- signal nesveikas
- otherwise
- signal gausas
- END
- kaisveikas :
- a11=x11/x11
- a12=x12/x11
- b11=laisv1/x11
- a22=a12*-x21+x22
- b21=b11*-x21+laisv2
- x2=b21/a22
- x1=x2*-a12+b11
- say "Ats: x1,x2=" x1 x2
- nesveikas :
- x21=x21*-1
- x22=x22*-1
- laisv2=laisv2*-1
- a11=x11/x11
- a12=x12/x11
- b11=laisv1/x11
- a22=a12*-x21+x22
- b21=b11*-x21+laisv2
- x2=b21/a22
- x1=x2*-a12+b11
- say "Ats: x1=" x1
- say " x2=" x2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement