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

Лабораторная работа №3 - Садовничий #112

Open
wants to merge 10 commits into
base: Sadovnichij_Denis_Vladimirovich
Choose a base branch
from
Binary file added .DS_Store
Binary file not shown.
Binary file added golang/.DS_Store
Binary file not shown.
24 changes: 22 additions & 2 deletions golang/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
package main

import "fmt"
import (
Copy link
Contributor

Choose a reason for hiding this comment

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

файлики .DS_Store добавьте в gitignore

Copy link
Contributor

@jskonst jskonst Dec 2, 2022

Choose a reason for hiding this comment

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

Все еще не удалили DS_Store, а без этого не смогу заапрувить PR

"fmt"
"math"
)

func main() {
fmt.Println("Hello world")
fmt.Println("___Задание А___")
var x float64 = 1.2
for ; x < 4.2; x = 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.

а почему тут не объявить x ?

fmt.Println(formula(x))
}
fmt.Println("___Задание В___")
fmt.Println(formula(1.16))
fmt.Println(formula(1.32))
fmt.Println(formula(1.47))
fmt.Println(formula(1.65))
fmt.Println(formula(1.93))
}

func formula(x float64) float64 {
var a float64 = 2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

a и b тоже сделайте параметрами функции


var y float64 = (math.Log10(a + x)) / ((a + x) * (a + x))
return y
}