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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.DS_Store
golang/.DS_Store
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

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 надо удалить

Copy link
Contributor

Choose a reason for hiding this comment

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

Сам бинарный файл все еще присутствует в репозитории
https://stackoverflow.com/questions/13541615/how-to-remove-files-that-are-listed-in-the-gitignore-but-still-on-the-repositor

Copy link
Contributor

Choose a reason for hiding this comment

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

А почему опять файлик DsStore попал? мы ж в прошлый раз починили?

Binary file added golang/.DS_Store
Binary file not shown.
39 changes: 37 additions & 2 deletions golang/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
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")
var masB = []float64{1.16, 1.32, 1.47, 1.65, 1, 93}
const a float64 = 2.0

// var masA []float64 = make([]float64, 0)
fmt.Println("___Задание А___")
fmt.Println(TaskA(a))
Copy link
Contributor

Choose a reason for hiding this comment

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

В задачу а также нужно передать диапазон изменения х

Copy link
Contributor

Choose a reason for hiding this comment

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

все еще не поменялось

fmt.Println("___Задание В___")
fmt.Println(TaskB(a, masB))
}

func TaskA(a float64) []float64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func TaskA(a float64) []float64 {
func TaskA(a, xn, xk, dx float64) []float64 {

var taskA []float64
var nx float64 = 1.2
var kx float64 = 4.2
var dx float64 = 0.6

for x := nx; x <= kx; x += dx {
taskA = append(taskA, formula(x, a))
}
return taskA
}

func TaskB(b float64, masB []float64) []float64 {
var taskB []float64
for i := 0; i < len(masB); i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for i := 0; i < len(masB); i++ {
for i, item := range masB {

taskB = append(taskB, formula(masB[i], b))
}
return taskB
}

func formula(x float64, a float64) float64 {
var y float64 = (math.Log10(a + x)) / ((a + x) * (a + x))
return y
}
Binary file added python/.DS_Store
Binary file not shown.