Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Seminars/Seminar03/Self/Task01/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
internal class program
{
public static void Main()
{
Console.Write("Введите количество углов: ");
int n = Convert.ToInt32(Console.ReadLine());

Console.Write("Введите длину стороны: ");
float l = Convert.ToSingle(Console.ReadLine());

Console.Write($"Площадь фигуры равна: {(n * Math.Pow(l, 2)) / (4 * Math.Tan(Math.PI / n))}");

Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task01/Task01.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
39 changes: 39 additions & 0 deletions Seminars/Seminar03/Self/Task02/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
internal class Program
{
public static void Main()
{
Console.Write("Введите x: ");
float x = Convert.ToSingle(Console.ReadLine());

Console.Write("Введите y: ");
float y = Convert.ToSingle(Console.ReadLine());

double length = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));


if (y < 0)
{
Console.WriteLine("Точка не принадлежит области");
Console.ReadKey();
return;
}
if (length > 2)
{
Console.WriteLine("Точка не принадлежит области");
}
else if (length == 2 || length == 1)
{
Console.WriteLine("Точка лежит на границе");
}
else if (length < 2 && length > 1)
{
Console.WriteLine("Точка лежит внутри области");
}
else
{
Console.WriteLine("Точка не принадлежит области");
}

Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task02/Task02.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
43 changes: 43 additions & 0 deletions Seminars/Seminar03/Self/Task03/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.ComponentModel.Design;

internal class Program
{
public static void Main()
{
Console.Write("Введите x: ");
float x = Convert.ToSingle(Console.ReadLine());

Console.Write("Введите y: ");
float y = Convert.ToSingle(Console.ReadLine());

double length = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));


if ((y < 0) && length > 1)
{
Console.WriteLine("Точка не принадлежит области");
}
else if ((y < 0) && length < 1)
{
Console.WriteLine("Точка лежит внутри области");
}
else if ((y < 0) && length == 1)
{
Console.WriteLine("Точка лежит на границе");
}
else if (length > 2)
{
Console.WriteLine("Точка не принадлежит области");
}
else if (length == 2)
{
Console.WriteLine("Точка лежит на границе");
}
else if (length < 2)
{
Console.WriteLine("Точка лежит внутри области");
}

Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task03/Task03.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
32 changes: 32 additions & 0 deletions Seminars/Seminar03/Self/Task04/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
internal class Program
{
public static void Main()
{
Console.Write("Введите x: ");
int x = Convert.ToInt32(Console.ReadLine());

Console.Write("Введите y: ");
int y = Convert.ToInt32(Console.ReadLine());

if (x < y)
{
double F = Math.Sin(x) + Math.Pow(Math.Cos(y), 2);
Console.WriteLine($"x, y, F: {x}, {y}, {F}");
}
else if (x == y)
{
double F = Math.Log(Math.Abs(x));
Console.WriteLine($"x, y, F: {x}, {y}, {F}");

}
else if (x > y)
{
double F = Math.Sin(Math.Pow(x, 2)) + Math.Cos(y);
Console.WriteLine($"x, y, F: {x}, {y}, {F}");

}

Console.ReadLine();

}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task04/Task04.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
45 changes: 45 additions & 0 deletions Seminars/Seminar03/Self/Task05/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
internal class Program
{
public static void Main()
{
Console.Write("Введите a: ");
double a = Convert.ToSingle(Console.ReadLine());

Console.Write("Введите b: ");
double b = Convert.ToSingle(Console.ReadLine());

Console.Write("Введите c: ");
double c = Convert.ToSingle(Console.ReadLine());

string s_a = a < 0 ? $"{a}" : $"+{a}";
string s_b = b < 0 ? $"{b}" : $"+{b}";
string s_c = c < 0 ? $"{c}" : $"+{c}";

Console.WriteLine($"{s_a}x^2{s_b}x{s_c}");

if (a == 0)
{
Console.WriteLine($"Единственный корень, равный {-c / b}");
}
else if (b == 0)
{
Console.WriteLine($"Два одинаковых корня, равных +-{Math.Sqrt(-c / a)}");
}
else if ((Math.Pow(b, 2) - 4 * a * c) < 0)
{
Console.WriteLine("Нет действительных корней");
}
else if ((Math.Pow(b, 2) - 4 * a * c) == 0)
{
Console.WriteLine($"Один корень, равный: {-b / (2 * a)}");
}
else if ((Math.Pow(b, 2) - 4 * a * c) > 0)
{
double D = Math.Pow(b, 2) - 4 * a * c;
Console.WriteLine($"Первый корень, равный: {(-b - Math.Sqrt(D))/ (2 * a)}");
Console.WriteLine($"Второй корень, равный: {(-b - Math.Sqrt(D)) / (2 * a)}");
}

Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task05/Task05.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
22 changes: 22 additions & 0 deletions Seminars/Seminar04/Self/Task01/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
internal class Program
{
public static void Main()
{
string? a = Console.ReadLine();
char b = a[0];
int c = Convert.ToInt32(b);

int F = c switch
{
>= 48 and <= 57 => 100,
>= 65 and <= 90 => 200,
>= 97 and <= 122 => 300,
_ => 400
};

Console.WriteLine(F);
Console.ReadKey();

Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar04/Self/Task01/Task01.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
34 changes: 34 additions & 0 deletions Seminars/Seminar04/Self/Task02/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
internal class Program
{
public static void Main()
{
string? data = Console.ReadLine();

int output = data.ToLower() /* Nintendo */ switch
{
"january" or "январь" => 1,
"february" or "февраль" => 2,
"march" or "март" => 3,
"april" or "апрель" => 4,
"may" or "май" => 5,
"june" or "июнь" => 6,
"july" or "июль" => 7,
"august" or "август" => 8,
"september" or "сентябрь" => 9,
"october" or "октябрь" => 10,
"november" or "ноябрь" => 11,
"december" or "декабрь" => 12,
_ => 0
};

if (output == 0)
{
Console.WriteLine("В году такой месяц отсутствует");
Console.ReadKey();
return;
}

Console.WriteLine(output);
Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar04/Self/Task02/Task02.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
48 changes: 48 additions & 0 deletions Seminars/Seminar04/Self/Task03/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
internal class Program
{
public static void Main()
{
Console.Write("Введите код операции: ");
bool code_flag = int.TryParse(Console.ReadLine(), out int code);

if (code == 0)
{
Console.WriteLine("Некорректно введено значение кода операции");
Console.ReadKey();
return;
}

Console.Write("Введите A: ");
bool a_flag = Single.TryParse(Console.ReadLine(), out float a);

if (a == 0)
{
Console.WriteLine("Некорректно введено значение A");
Console.ReadKey();
return;
}

Console.Write("Введите B: ");
bool b_flag = Single.TryParse(Console.ReadLine(), out float b);

if (b == 0)
{
Console.WriteLine("Некорректно введено значение B");
Console.ReadKey();
return;
}

switch (code)
{
case 1:
Console.WriteLine($"{a} + {b} = {a + b}"); break;
case 2:
Console.WriteLine($"{a} - {b} = {a - b}"); break;
case 3:
Console.WriteLine($"{a} * {b} = {a * b}"); break;
case 4:
Console.WriteLine($"{a} / {b} = {a / b}"); break;
}
Console.ReadKey();
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar04/Self/Task03/Task03.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Binary file modified Seminars/Seminar04/Self/images/Self01.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.