Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. Sub task1()
  2. Dim x, result As Double
  3. x = Cells(1, 2)
  4. If x >= -3.5 Then
  5. result = 4 * x ^ 2 + 2 * x + 19
  6. End If
  7. If x < -3.5 Then
  8. result = -2 * x / (-4 * x + 1)
  9. End If
  10. Cells(2, 2) = result
  11. End Sub
  12.  
  13. Sub task1()
  14. Dim years(13) As String
  15. Dim x As Integer
  16. x = Cells(1, 2)
  17. years(0) = "Êðûñà"
  18. years(1) = "Êîðîâà"
  19. years(2) = "Òèãð"
  20. years(3) = "Çàÿö"
  21. years(4) = "Äðàêîí"
  22. years(5) = "Çìåÿ"
  23. years(6) = "Ëîøàäü"
  24. years(7) = "Îâöà"
  25. years(8) = "Îáåçüÿíà"
  26. years(9) = "Êóðèöà"
  27. years(10) = "Ñîáàêà"
  28. years(11) = "Ñâèíüÿ"
  29. x = x Mod 12
  30. Cells(2, 2) = years(x)
  31. End Sub
  32.  
  33. Sub task1()
  34. Dim x, num As Double
  35. x = Cells(1, 2)
  36. For i = 1 To x
  37. x = x + 1
  38. num = ((2 ^ (2 * x + 1)) + 1) / 3
  39. Cells(i, 1) = num
  40. Next i
  41. End Sub
  42.  
  43. Sub task1()
  44. Dim result As Double
  45. result = 1
  46. For i = 1 To 999
  47. result = result * (1 + Math.Sin(0.1 * i))
  48. Next i
  49. Cells(1, 1) = result
  50. End Sub
  51.  
  52.  
  53. Sub task1()
  54. Dim result, n, a, b, f, check, res As Double
  55. n = 10
  56. check = 0.01
  57. For i = 1 To 5
  58. a = 1
  59. b = 1
  60. For c = 1 To i
  61. a = a * c
  62. Next c
  63. f = 2 ^ i
  64. For c = 1 To f
  65. b = b * c
  66. Next c
  67. result = a / b
  68. If result >= check Then
  69. res = res + result
  70. End If
  71. Next i
  72. MsgBox res
  73. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement