Advertisement
Guest User

Untitled

a guest
Dec 17th, 2013
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rexx 0.96 KB | None | 0 0
  1. gausas :
  2. Say "Skaiciujame lygciu sistema (2x2) "Zordano Gauso" budu"
  3. x11=
  4. x12=
  5. x21=
  6. x22=
  7. laisv1=
  8. laisv2=
  9. say "Iveskite skaiciu esanti prie X1 pirmoje lygtyje"
  10. pull x11
  11. say "Iveskite skaiciu esanti prie X2 pirmoje lygtyje"
  12. pull x12
  13. say "Iveskite laisvaji nari esanti pirmoje lygtyje"
  14. pull laisv1
  15. say "Iveskite skaiciu esanti prie X1 antroje lygtyje"
  16. pull x21
  17. say "Iveskite skaiciu esanti prie X2 antroje lygtyje"
  18. pull x22
  19. say "Iveskite laisvaji nari esanti antroje lygtyje"
  20. pull laisv2
  21. select
  22.     when x21>0
  23.         then
  24.             signal kaisveikas
  25.     when x21<0
  26.         then
  27.             signal nesveikas
  28.     otherwise
  29.         signal gausas
  30. END        
  31. kaisveikas :
  32. a11=x11/x11
  33. a12=x12/x11
  34. b11=laisv1/x11
  35. a22=a12*-x21+x22
  36. b21=b11*-x21+laisv2
  37. x2=b21/a22
  38. x1=x2*-a12+b11
  39. say "Ats: x1,x2=" x1 x2
  40. nesveikas :
  41. x21=x21*-1
  42. x22=x22*-1
  43. laisv2=laisv2*-1
  44. a11=x11/x11
  45. a12=x12/x11
  46. b11=laisv1/x11
  47. a22=a12*-x21+x22
  48. b21=b11*-x21+laisv2
  49. x2=b21/a22
  50. x1=x2*-a12+b11
  51. say "Ats: x1=" x1
  52. say "     x2=" x2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement