Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Боков Кирилл 1/42 - Сделал оставшиеся функции, исправил ошибки #148

Open
wants to merge 6 commits into
base: Bokov_Kirill_Mihajlovich
Choose a base branch
from
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Репозиторий для работ по курсу информатика

Вот сюда нужно будет в первой работе с гитом добавит свое ФИО
Боков Кирилл Михайлович

## ФИО

Expand Down
13 changes: 13 additions & 0 deletions golang/lab.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import "math"

func lab(a float64, b float64, x float64) float64 {
v2 := math.Pow(a+b*x, 2.5) / (1.8 + math.Pow(math.Cos(a*x), 3))
if (x > 5) && (v2 >= 5) {
y := math.Pow(math.Log10(math.Pow(a, 2)-x), 2) / math.Pow(a+x, 2)
return y
} else {
return 0
}
}
9 changes: 9 additions & 0 deletions golang/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ import "fmt"

func main() {
fmt.Println("Hello world")
fmt.Println(lab(-2.5, 3.4, 5.1))
for x := 3.5; x <= 6.5; x += 0.6 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

чтобы починить линтеровские параметры вызовите функцию передав ей другое значение a - ну или давайте правило линтера временно отключим

fmt.Println(lab(-2.5, 3.4, x))
}
fmt.Println(lab(-2.5, 3.4, 2.89))
fmt.Println(lab(-2.5, 3.4, 3.54))
fmt.Println(lab(-2.5, 3.4, 5.21))
fmt.Println(lab(-2.5, 3.4, 6.28))
fmt.Println(lab(-2.5, 3.4, 3.48))
}