Console.WriteLine ("Please enter your ID number");
string x = Console.ReadLine ();
String year=x.substring (6,4);//starting from the sixth position of the ID card, intercept four, which is your year of birth
int x1 = Convert.ToInt32 (year);//The interception into the years into the X1,
string sx = "";
Switch (X1%12)//Enter a year, if the assumption is four, you can judge the year of the zodiac, and then according to the 12 zodiac arrangement, to determine the balance of 0 to 12 of which Zodiac
{
Case 0:
Sx= "Dog";
Break
Case 1:
SX = "Chicken";
Break
Case 2:
SX = "Monkey";
Break
Case 3:
SX = "Sheep";
Break
Case 4:
SX = "Horse";
Break
Case 5:
SX = "Snake";
Break
Case 6:
SX = "Dragon";
Break
Case 7:
SX = "Rabbit";
Break
Case 8:
SX = "Tiger";
Break
Case 9:
SX = "cow";
Break
Case 10:
SX = "Rat";
Break
Case 11:
SX = "Pig";
Break
Default:
SX = "Please enter the correct year";
Break
}
Console.WriteLine ("Your Zodiac is" +sx);
Console.ReadLine ();
Example: Enter your ID number to determine what zodiac you are. Switch,case exercises, the substring class uses the contact, will use to take the remainder