Advertisement
SaNeLSANY

Form(2darray)

Mar 31st, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. Private Sub Command1_Click()
  2. Max = Niz(1, 1)
  3. For i = 1 To 5
  4. For j = 1 To 5
  5. If Niz(i, j) > Max Then Max = Niz(i, j)
  6. Next j
  7. Next i
  8. Print
  9. Print "Maksimalna vrijednost u nizu je: "; Max
  10. End Sub
  11.  
  12. Private Sub Command2_Click()
  13. BrojPozElem = 0
  14. For i = 1 To 5
  15. For j = 1 To 5
  16. If Niz(i, j) > 0 Then BrojPozElem = BrojPozElem + 1
  17. Next j
  18. Next i
  19. Print
  20. Print "Broj pozitivnih elemenata u nizu je: "; BrojPozElem
  21. End Sub
  22.  
  23. Private Sub Command3_Click()
  24. End
  25. End Sub
  26.  
  27. Private Sub Command4_Click()
  28. Min = Niz(1, 1)
  29. For i = 1 To 5
  30. For j = 1 To 5
  31. If Niz(i, j) < Min Then Min = Niz(i, j)
  32. Next j
  33. Next i
  34. Print
  35. Print "Minimalna vrijednost u nizu je: "; Min
  36. End Sub
  37.  
  38. Private Sub Command5_Click()
  39. BrojNegElem = 0
  40. For i = 1 To 5
  41. For j = 1 To 5
  42. If Niz(i, j) < 0 Then BrojNegElem = BrojNegElem + 1
  43. Next j
  44. Next i
  45. Print
  46. Print "Broj negativnih elemenata u nizu je: "; BrojNegElem
  47. End Sub
  48.  
  49. Private Sub Command6_Click()
  50. Dim Title$
  51. Dim Prompt$
  52. Cls
  53. Title$ = "Unesi vrijednosti elementima 2D niza,"
  54. For i = 1 To 5
  55. For j = 1 To 5
  56. Prompt$ = "za elemenat Niz (" & i & "," & j & ")"
  57. Niz(i, j) = InputBox(Prompt$, Title$)
  58. Next j
  59. Next i
  60. End Sub
  61.  
  62. Private Sub Command7_Click()
  63. Dim a As Integer
  64. Print "Vrijednosti elemenata 2D niza:"
  65. Print
  66. a = 100
  67. For i = 1 To 5
  68. a = a + 300
  69. For j = 1 To 5
  70. CurrentY = a
  71. CurrentX = 0 + 500 * j
  72. Print Niz(i, j)
  73. Next j
  74. Next i
  75. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement