Compare commits

...

5 Commits

Author SHA1 Message Date
4fd2ea4aea update 2026-02-02 06:44:35 +04:00
a7b9c3409e Update README.md 2026-02-01 22:31:49 +04:00
6e5fa35376 Update main.yml 2026-02-01 22:31:43 +04:00
ed69e99972 Update github action.yml 2026-02-01 22:24:16 +04:00
de9e401e8e Create github action.yml 2026-02-01 22:20:41 +04:00
4 changed files with 78 additions and 2 deletions

31
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Autotests CI
on:
push:
branches:
- '**'
jobs:
test-job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
working-directory: ./LR1
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./LR1
- name: Run unit tests
run: dotnet test --no-build --verbosity normal
working-directory: ./LR1

View File

@@ -1,18 +1,37 @@
internal class Program
{
private static float[] inputArray = {
1.5f, -2.4f, 3.1f, 0.5f, 12.7f, -8.2f, 4.4f, 9.0f, 01511.0f
};
1.5f, -2.4f, 3.1f, 0.5f, 12.7f, -8.2f, 4.4f, 9.0f, 0.0f, 11.1f,
-3.3f, 6.7f, 15.2f, 2.8f, 7.0f, -1.1f, 4.9f, 8.3f, 22.5f, 0.2f,
5.6f, -9.4f, 13.0f, 1.1f, 3.7f, 18.2f, -4.5f, 6.0f, 0.9f, 10.4f,
2.2f, -7.7f, 14.1f, 3.3f, 5.8f, 21.0f, -0.5f, 8.8f, 1.4f, 12.3f,
4.0f, -6.1f, 17.5f, 2.9f, 9.2f, 19.8f, -2.2f, 7.4f, 0.3f, 11.9f
};
private static void Main()
{
Console.WriteLine($"Массив с входными данными: [{string.Join("; ", inputArray)}]");
var outputData = ArrayProc(inputArray);
var minValue = SearchMinValue(outputData);
Console.WriteLine($"Массив с выходными данными: [{string.Join("; ", outputData ?? Array.Empty<float>())}]");
Console.WriteLine($"Минимальное значенние: {minValue.ToString()}");
}
private static float SearchMinValue(float[]? inputData)
{
if (inputData == null || inputData.Length == 0) return 0;
var minValue = inputData[0];
for (int i = 1; i < inputData.Length; i++)
{
if (inputData[i] < minValue) minValue = inputData[i];
}
return minValue;
}
private static float[]? ArrayProc(float[] inputData)
{
float[] outputArray;

View File

@@ -1 +1,24 @@
import random
import struct
MIN_FLOAT = -3.4028235e38
MAX_FLOAT = 3.4028235e38
def generate_and_solve():
length = random.randint(0, 1024)
input_data = [random.uniform(MIN_FLOAT, MAX_FLOAT) for _ in range(length)]
n = len(input_data) - 1
limit = n // 2
pairs = []
for i in range(limit + 1):
if i + 8 <= n:
pairs.append(input_data[i] * input_data[i+8])
if len(pairs) % 2 != 0:
mid = len(pairs) // 2
pairs[mid] = pairs[mid] ** 2
generate_and_solve()

View File

@@ -1,4 +1,7 @@
# ISTU_TEST_LR1
[![Autotests CI](https://github.com/KhasanovAMdev/ISTU_TEST_LR1/actions/workflows/main.yml/badge.svg)](https://github.com/KhasanovAMdev/ISTU_TEST_LR1/actions/workflows/main.yml)
гр. Б22-191-1з, Хасанов Артур Марсович.
Задание - вариант 35