Fortune Telling Collection - Zodiac Guide - C language uses switches to input the year of birth and output the zodiac.
C language uses switches to input the year of birth and output the zodiac.
The simple code is as follows:
Enter the year and take the remainder of 12 to know the zodiac.
# include & ltstdio.h & gt
int main()
{
Int year, t;
Scanf ("%d ",& year);
T = year%12;
Switch (t)
Case 0:
Printf ("monkey"); Break;
Case 1:
Printf ("chicken"); Break;
Case 2:
Printf ("dog"); Break;
Case 3:
printf(" pig "); Break;
Case 4:
Printf ("mouse"); Break;
Case 5:
printf(" cow "); Break;
Case 6:
Printf ("tiger"); Break;
Case 7:
Printf ("rabbit"); Break;
Case 8:
Printf ("dragon"); Break;
Case 9:
Printf ("snake"); Break;
Case 10:
Printf ("horse"); Break;
Case 1 1:
Printf ("sheep"); Break;
}
Returns 0;
}
- Previous article:Capricorn male speed dating constellation
- Next article:Constellation girl who makes men give up.
- Related articles
- 16' s Pawnshop No.8, why is the hostess Jing still popular?
- Which constellation is colder _ Which constellation is colder for girls?
- Twelve constellations Spring Festival noble fortune _ twelve constellations Spring Festival noble fortune
- Name Zhang Chuanjun Sex Male Birth1994 65438+1October 6th Parents' Name Zhang Shibao Zhang Yu I want to use five elements to get a name. What should I bring? ...
- My birthday is April 5th. Then what constellation am I? I was born in 2000. Be sure to be accurate!
- What does Pisces mean by bowing its head and apologizing to you?
- 9 what constellation
- What is the constellation of 65438+1October 7th _ 65438+1October 7th?
- Lunar June what constellation _ lunar June what constellation query
- Which country's brand is ADAC (the most authoritative crash test for children's car seats in the world) for four consecutive years?