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
49 changes: 49 additions & 0 deletions Seminars/Seminar07/Self/Seminar07Self.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Self01", "Task01\Self01\Self01.csproj", "{229ADD90-6325-4CC5-9F61-E27447E1B62C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Self02", "Task02\Self02\Self02.csproj", "{AC47E25A-240E-48E8-825A-2D83D0CBD285}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Self03", "Task03\Self03\Self03.csproj", "{183AA642-EFF6-4BE2-9A6D-7C77D16B814B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Self04", "Task04\Self04\Self04.csproj", "{4C800379-3288-472E-8E77-8DBC8428564E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Self05", "Task05\Self05\Self05.csproj", "{505D0A18-A2BD-4812-AB21-18CED6DE7999}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{229ADD90-6325-4CC5-9F61-E27447E1B62C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{229ADD90-6325-4CC5-9F61-E27447E1B62C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{229ADD90-6325-4CC5-9F61-E27447E1B62C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{229ADD90-6325-4CC5-9F61-E27447E1B62C}.Release|Any CPU.Build.0 = Release|Any CPU
{AC47E25A-240E-48E8-825A-2D83D0CBD285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC47E25A-240E-48E8-825A-2D83D0CBD285}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC47E25A-240E-48E8-825A-2D83D0CBD285}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC47E25A-240E-48E8-825A-2D83D0CBD285}.Release|Any CPU.Build.0 = Release|Any CPU
{183AA642-EFF6-4BE2-9A6D-7C77D16B814B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{183AA642-EFF6-4BE2-9A6D-7C77D16B814B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{183AA642-EFF6-4BE2-9A6D-7C77D16B814B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{183AA642-EFF6-4BE2-9A6D-7C77D16B814B}.Release|Any CPU.Build.0 = Release|Any CPU
{4C800379-3288-472E-8E77-8DBC8428564E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C800379-3288-472E-8E77-8DBC8428564E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C800379-3288-472E-8E77-8DBC8428564E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C800379-3288-472E-8E77-8DBC8428564E}.Release|Any CPU.Build.0 = Release|Any CPU
{505D0A18-A2BD-4812-AB21-18CED6DE7999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{505D0A18-A2BD-4812-AB21-18CED6DE7999}.Debug|Any CPU.Build.0 = Debug|Any CPU
{505D0A18-A2BD-4812-AB21-18CED6DE7999}.Release|Any CPU.ActiveCfg = Release|Any CPU
{505D0A18-A2BD-4812-AB21-18CED6DE7999}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {05BB22C1-5A52-4FF3-B82D-ED7F8891E830}
EndGlobalSection
EndGlobal
27 changes: 27 additions & 0 deletions Seminars/Seminar07/Self/Task01/Self01/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace Self01
{
internal class Program
{

public static void Triangle(int n)
{
for (int i = 1; i <= n; i++)
{
for (int j = i; j >= 1; j--)
{
Console.Write("*");
}
Console.Write("\n");
}
}
static void Main(string[] args)
{
int.TryParse(Console.ReadLine(), out int n);

if (n > 0)
{
Triangle(n);
}
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar07/Self/Task01/Self01/Self01.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/Seminar07/Self/Task02/Self02/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Self02
{
internal class Program
{


public static void Ornament(int n, int m)
{
for (int i = 0; i < m; i++)
{
TriangleClass.Triangle(n);
}
}
static void Main(string[] args)
{
if (int.TryParse(Console.ReadLine(), out int n) && n > 0 && int.TryParse(Console.ReadLine(), out int m) && m > 0)
{
Ornament(n, m);
}
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar07/Self/Task02/Self02/Self02.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>
23 changes: 23 additions & 0 deletions Seminars/Seminar07/Self/Task02/Self02/TriangleClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Self02
{
internal class TriangleClass
{
public static void Triangle(int n)
{
for (int i = 1; i <= n; i++)
{
for (int j = i; j >= 1; j--)
{
Console.Write("*");
}
Console.Write("\n");
}
}
}
}
36 changes: 36 additions & 0 deletions Seminars/Seminar07/Self/Task03/Self03/ModOrnamentClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Self03
{
internal class ModOrnamentClass
{
public static void ModOrnament(int n, int m)
{
for (int i = 1; i <= n; i++)
{
string str = "*";

for (int j = i; j > 1 ; j--)
{
str += "*";
}

for (int s = 0; s < n - i; s++)
{
str += " ";
}

for (int k = 0; k < m; k++)
{
Console.Write(str);
}
Console.WriteLine();

}
}
}
}
14 changes: 14 additions & 0 deletions Seminars/Seminar07/Self/Task03/Self03/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Self03
{
internal class Program
{
static void Main(string[] args)
{
if (int.TryParse(Console.ReadLine(), out int n) && n > 0 && int.TryParse(Console.ReadLine(), out int m) && m > 0)
{
ModOrnamentClass.ModOrnament(n, m);
}

}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar07/Self/Task03/Self03/Self03.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>
14 changes: 14 additions & 0 deletions Seminars/Seminar07/Self/Task04/Self04/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Self04
{
internal class Program
{
static void Main(string[] args)
{
if (int.TryParse(Console.ReadLine(), out int n) && n > 0)
{
PythonClass.DrawPython(n);
}

}
}
}
51 changes: 51 additions & 0 deletions Seminars/Seminar07/Self/Task04/Self04/PythonClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Self04
{
internal class PythonClass
{
const string firstStr = "***";
const string middleStr = "* *"; // введем константные поля для того, чтобы из них формировать строку (первую из firstStr, остальные из middleStr)

public static void DrawPython(int n)
{
for (int i = 0; i < n; i++) // будем отрисовывать каждую строку, с помощью n итераций цикла
{

if (i == 0)
{
for (int j = 0; j < n; j++)
{
Console.Write(firstStr + " ");
}
}


else if (i == n - 1)
{
for (int j = 0; j < n - 1; j++)
{
Console.Write(middleStr + "*");
}
Console.Write(middleStr);
}


else
{
for (int j = 0; j < n; j++)
{
Console.Write(middleStr + " ");
}
}


Console.WriteLine();
}
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar07/Self/Task04/Self04/Self04.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>
52 changes: 52 additions & 0 deletions Seminars/Seminar07/Self/Task05/Self05/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace Self05
{
internal class Program
{
static int GetNOK(int n, int m)
{
for (int i = Math.Min(n, m); i <= n * m; i++)
{
if (i % n == 0 && i % m == 0)
{
return i;

}
}
return 0;
}

static int GetNOD(int n, int m)
{
for (int i = Math.Min(n, m); i >= 1; i--)
{

if (n % i == 0 && m % i == 0)
{
return i;
}

}
return 1;
}

static void Main(string[] args)
{
Console.Write("Введите числитель: ");
int.TryParse(Console.ReadLine(), out int n);
Console.WriteLine();

Console.Write("Введите знаменатель: ");
int.TryParse(Console.ReadLine(), out int m);
Console.WriteLine();

if (n > 0 && m > 0)
{
int nod = GetNOD(n, m);
int nok = GetNOK(n, m);

Console.WriteLine($"Результат: {n / nod}/{m / nod}");
Console.WriteLine($"НОК: {nok}");
}
}
}
}
10 changes: 10 additions & 0 deletions Seminars/Seminar07/Self/Task05/Self05/Self05.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>