forked from Leberty/SoftwareTestingConsole
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnum.cs
More file actions
48 lines (46 loc) · 1.37 KB
/
Enum.cs
File metadata and controls
48 lines (46 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//Тип перечисление
//Перечисление ВременаГода
enum YearSeasons
{
Summer, //Лето
Autumn, //Осень
Winter, //Зима
Spring //Весна
}
namespace Enum
{
internal class Program
{
static void Main(string[] args)
{
YearSeasons summer = YearSeasons.Summer;
if (summer == YearSeasons.Summer)
{
Console.WriteLine("Сейчас лето");
}
else
{
Console.WriteLine("Лето еще не наступило");
}
PrintMessage(YearSeasons.Summer);
PrintMessage(YearSeasons.Winter);
}
static void PrintMessage(YearSeasons currentSeasons)
{
switch(currentSeasons) {
case YearSeasons.Summer:
Console.WriteLine("Сейчас лето");
break;
case YearSeasons.Winter:
Console.WriteLine("Скоро Новый Год");
break;
case YearSeasons.Autumn:
Console.WriteLine("Скоро в школу");
break;
case YearSeasons.Spring:
Console.WriteLine("Скоро в отпуск");
break;
}
}
}
}