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
12 changes: 12 additions & 0 deletions Seminars/Seminar03/Self/Task01/Program/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

class Program{
static void Main(){
int n = int.Parse(Console.ReadLine());
double l = double.Parse(Console.ReadLine());
if(1<=n && n<11 && l>0){
double s = (n*l*l)/(4*Math.Tan(Math.PI/n));
Console.WriteLine(s);
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task01/Program/Program.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

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

class Program{
static void Main(){
double x = double.Parse(Console.ReadLine());
double y = double.Parse(Console.ReadLine());

if (y < 0){
Console.WriteLine($"Точка ({x};{y}) не принадлежит точки области");
return;
}

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

if (d == 1 || d == 2){
Console.WriteLine($"Точка ({x};{y}) попадает на границу области");
}
else if (d < 2 && d > 1){
Console.WriteLine($"Точка ({x};{y}) попадает в область");
}
else{
Console.WriteLine($"Точка ({x};{y}) не принадлежит точки области");
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task02/Program2/Program2.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

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

class Program{
static void Main(){
double x = double.Parse(Console.ReadLine());
double y = double.Parse(Console.ReadLine());

double d = Math.Sqrt(Math.Pow(x, 2)+Math.Pow(y, 2));
string message;

if (y < 0){
message = Check_cord(x, y, d, 1);
}
else{
message = Check_cord(x, y, d, 2);
}
Console.WriteLine(message);
}

public static string Check_cord(double x, double y, double d, double radius){
string message;
if (d == radius){
message = $"Точка ({x};{y}) попадает на границу области";
}
else if(d < radius){
message = $"Точка ({x};{y}) попадает в область";
}
else{
message = $"Точка ({x};{y}) не принадлежит точки области";
}
return message;
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task03/Program3/Program3.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

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

class Program{
static void Main(){
double x = double.Parse(Console.ReadLine());
double y = double.Parse(Console.ReadLine());
double f;

if (x < y){
f = Math.Sin(x) + Math.Pow(Math.Cos(y), 2);
}
else if(x > y){
f = Math.Sin(Math.Pow(y, 2)) + Math.Cos(y);
}
else{
f = Math.Log10(x);
}
Console.WriteLine(f);
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task04/Program4/Program4.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

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

class Program{
static void Main(){
double a = double.Parse(Console.ReadLine());
double b = double.Parse(Console.ReadLine());
double c = double.Parse(Console.ReadLine());

double d = Math.Pow(b, 2) - 4*a*c;
if (d < 0){
Console.WriteLine("Нету корней");
}
else if(d > 0){
double x1 = (-b-Math.Sqrt(d))/2*a;
double x2 = (-b+Math.Sqrt(d))/2*a;
Console.WriteLine("Урванение имеет 2 корня:");
Console.WriteLine($"x1 = {x1}");
Console.WriteLine($"x2 = {x2}");
}
else{
double x = -b/2*a;
Console.WriteLine($"Уравнение имеет один корень: x = {x}");
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar03/Self/Task05/Program5/Program5.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
22 changes: 22 additions & 0 deletions Seminars/Seminar04/Self/Task01/Program1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;

class Program{
static void Main(){
string str = Console.ReadLine();
char element = str[0];
switch (element){
case >= '0' and <= '9':
Console.WriteLine("100");
break;
case >= 'A' and <= 'Z':
Console.WriteLine("200");
break;
case >= 'a' and <= 'z':
Console.WriteLine("300");
break;
default:
Console.WriteLine("400");
break;
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar04/Self/Task01/Program1/Program1.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
28 changes: 28 additions & 0 deletions Seminars/Seminar04/Self/Task02/Program42/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;

class Program{
static void Main(){
string str = Console.ReadLine();
int num = str switch{
"Январь" or "January" => 1,
"Февраль" or "Feburary" => 2,
"Март" or "Mart" => 3,
"Апрель" or "April" => 4,
"Май" or "May" => 5,
"Июнь" or "June" => 6,
"Июль" or "Jule" => 7,
"Август" or "August" => 8,
"Сентябрь" or "September" => 9,
"Октябрь" or "October" => 10,
"Ноябрь" or "November" => 11,
"Декабрь" or "December" => 12,
_=>0
};
if(num != 0){
Console.WriteLine(num);
}
else{
Console.WriteLine("В году такой месяц отсутствует.");
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar04/Self/Task02/Program42/Program42.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

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

class Program{
static void Main(){
Console.WriteLine("Введите код операции: ");
double o = double.Parse(Console.ReadLine());

Console.WriteLine("Введите А: ");
double a = double.Parse(Console.ReadLine());

Console.WriteLine("Введите B: ");
double b = double.Parse(Console.ReadLine());

if(b==0){
Console.WriteLine("B не может быть равен 0");
return;
}

switch (o)
{
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;

default:
Console.WriteLine("Нету такой операции");
break;

}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar04/Self/Task03/Program43/Program43.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>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>