Created
December 15, 2019 07:28
-
-
Save kanadeiar/2c8b2b42c1cf9c49ffdf276f3bdeb2ec to your computer and use it in GitHub Desktop.
Использование коллекций
This file contains hidden or 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
| var (bak, mag) = students.DetailCount; | |
| WriteLine($"Магистров: {mag}"); | |
| WriteLine($"Бакалавров: {bak}"); |
This file contains hidden or 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
| /// <summary> | |
| /// Количество бакалавров и магистров | |
| /// </summary> | |
| public (int Bak, int Mag) DetailCount | |
| { | |
| get | |
| { | |
| int bak = 0; | |
| int mag = 0; | |
| foreach (Student el in list) | |
| { | |
| if (el.Course < 5) | |
| bak++; | |
| else | |
| mag++; | |
| } | |
| return (bak, mag); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment