-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9c8f78
commit 83b632b
Showing
10 changed files
with
131 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using DigitalCathedral.Task1; | ||
|
||
try | ||
{ | ||
Student s1 = new Student("", "", "", "", "", 3); | ||
Student s2 = new Student("", "", "", "", "", 3); | ||
Console.WriteLine(s1.Equals(s2)); | ||
Student st = new Student("Ivanov", "Ivan", "Ivanovich", "M1O-301B-21", "1234-123-12", 3); | ||
|
||
Console.WriteLine("No exceptions were thrown"); | ||
} | ||
catch (ArgumentNullException ex) | ||
{ | ||
// | ||
Console.WriteLine(ex.Message); | ||
} | ||
catch (ArgumentException ex) | ||
{ | ||
// | ||
Console.WriteLine(ex.Message); | ||
} | ||
|
||
Console.WriteLine("after try/catch..."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
DigitalCathedral/CombinatoricsExtensions.cs → ...athedral.Task2/CombinatoricsExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace DigitalCathedral; | ||
namespace DigitalCathedral.Task2; | ||
|
||
public static class CombinatoricsExtensions | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using DigitalCathedral.Task2; | ||
|
||
try | ||
{ | ||
IEqualityComparer<int> equalityComparer = new IntEqualityComparer(); | ||
var values = new int [] { 1, 2, 3, 4, 5 }; | ||
values.GetCombinations(3, equalityComparer); | ||
} | ||
catch (ArgumentException ex) | ||
{ | ||
Console.WriteLine(ex.Message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Collections; | ||
|
||
namespace DigitalCathedral; | ||
|
||
public class IEnumerableImpl: | ||
IEnumerable<int> | ||
{ | ||
|
||
private readonly int[] _values = new[] { 1, 2, 3, 4, 5 }; | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return _values.GetEnumerator(); | ||
} | ||
|
||
public IEnumerator<int> GetEnumerator() | ||
{ | ||
for (var i = 0; i < _values.Length; i++) | ||
{ | ||
yield return _values[i]; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters