Last active
September 16, 2015 01:19
-
-
Save Tesla9527/375489a3ad297dcad912 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
/// <summary> | |
/// 定义枚举类型性别,只有两个值Male和Female | |
/// </summary> | |
enum Gender | |
{ | |
Male, | |
Female | |
} | |
class Program | |
{ | |
//定义常量PI | |
const double PI = 3.14; | |
static void Main(string[] args) | |
{ | |
Gender sex; | |
sex = Gender.Male; | |
switch (sex) | |
{ | |
case Gender.Male: | |
Console.Write("是个男的"); | |
break; | |
case Gender.Female: | |
Console.Write("是个女的"); | |
break; | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment