Skip to content

Instantly share code, notes, and snippets.

@kanadeiar
Created December 15, 2019 07:28
Show Gist options
  • Select an option

  • Save kanadeiar/2c8b2b42c1cf9c49ffdf276f3bdeb2ec to your computer and use it in GitHub Desktop.

Select an option

Save kanadeiar/2c8b2b42c1cf9c49ffdf276f3bdeb2ec to your computer and use it in GitHub Desktop.
Использование коллекций
var (bak, mag) = students.DetailCount;
WriteLine($"Магистров: {mag}");
WriteLine($"Бакалавров: {bak}");
/// <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