Fortune Telling Collection - Zodiac Guide - C program: Knowing that your birthday is 1 August 9971,output your horoscope.
C program: Knowing that your birthday is 1 August 9971,output your horoscope.
Invalid? Master ()
{
int? n,y,r;
Printf ("Please enter the year of your birthday: \ n");
scanf("%d ",& ampn);
Printf ("Please enter the month of your birthday: \ n");
scanf("%d ",& ampy);
What time? (y & lt 1 | | y & gt; 12)
{?
Printf ("Error, the month should be between 1- 12! \ n ");
Printf ("Please enter the month of your birthday: \ n");
scanf("%d ",& ampy);
}
Printf ("Please enter your birthday date: \ n");
scanf("%d ",& ampr);
while(y = = 1 | | y = = 3 | | y = = 5 | | y = = 7 | | y = = 8 | | y = = 10 | | y = = 12)
while(r & lt; 1 | | r & gt; 3 1)
{printf ("Error, the number of days can only be between 1-3 1! \ n ");
Printf ("Please enter your birthday date: \ n");
scanf("%d ",& ampr);
}
while(y = = 4 | | y = = 6 | | y = = 9 | | y = = 1 1)
while(r & lt; 1 | | r & gt; 30)
{printf ("Error, the number of days can only be between 1-30! \ n ");
Printf ("Please enter your birthday date: \ n");
scanf("%d ",& ampr); }
if(y = = 2 & amp; & amp((n%4==0n% 100! =0)||n%400==0))
while(r & lt; 1 | | r & gt; 29)?
{printf ("Error, the number of days can only be between 1-29! \ n ");
Printf ("Please enter your birthday date: \ n");
scanf("%d ",& ampr); }
Or what? If (y==2)
{printf ("Error, the number of days can only be between 1-29! \ n ");
Printf ("Please enter your birthday date: \ n");
scanf("%d ",& ampr); }
//The above is the correct input of a person's birthday date.
if(y = = 1 & amp; & ampr & lt2 1)? Printf ("for: Capricorn. \ n ");
Or what? What if? (y== 1)? Printf ("for: Aquarius. \ n ");
Or what? What if? (y = = 2 & amp& ampr & lt2 1)? Printf ("for: Aquarius. \ n ");
Or what? What if? (y==2)? Printf ("for: Pisces. \ n ");
Or what? What if? (y = = 3 & amp& ampr & lt2 1)? Printf ("for: Pisces. \ n ");
Or what? What if? (y==3)? Printf ("for: Aries. \ n ");
Or what? What if? (y = = 4 & amp& ampr & lt2 1)? Printf ("for: Aries. \ n ");
Or what? What if? (y==4)? Printf ("for: Taurus. \ n ");
Or what? What if? (y = = 5 & amp& ampr & lt22)? Printf ("for: Taurus. \ n ");
Or what? What if? (y==5)? Printf ("for: Gemini. \ n ");
Or what? What if? (y = = 6 & amp& ampr & lt22)? Printf ("for: Gemini. \ n ");
Or what? What if? (y==6)? Printf ("for: cancer. \ n ");
Or what? What if? (y = = 7 & amp& ampr & lt23)? Printf ("for: cancer. \ n ");
Or what? What if? (y==7)? Printf ("for: Leo。 \ n ");
Or what? What if? (y = = 8 & amp& ampr & lt23)? Printf ("for: Leo。 \ n ");
Or what? What if? (y==8)? Printf ("for: Virgo. \ n ");
Or what? What if? (y = = 9 & amp& ampr & lt23)? Printf ("for: Virgo. \ n ");
Or what? What if? (y==9)? Printf ("for: Libra. \ n ");
Or what? What if? (y = = 10 & amp; & ampr & lt24)? Printf ("for: Libra. \ n ");
Or what? What if? (y== 10)? Printf ("for: Scorpio. \ n ");
Or what? What if? (y = = 1 1 & amp; & ampr & lt23)? Printf ("for: Scorpio. \ n ");
Or what? What if? (y== 1 1)? Printf ("Sagittarius. \ n ");
Or what? What if? (y = = 12 & amp; & ampr & lt22)? Printf ("Sagittarius. \ n ");
Or what? Printf ("for: Capricorn. \ n ");
}
Note: The first half is to verify whether the entered year, month and day are correct.
The second half is to judge what constellation output.
PS::: If you don't understand, you can keep asking. . .
- Related articles
- 1What is the constellation of May 9th, 975?
- Tucao, 12 constellation is in the most unrequited love.
- 12 constellation eating posture _ Twelve constellations love eating meat ranking
- Cai Zhiyun's file?
- Query Ascending Constellation _ Query Ascending Constellation and Moon Constellation
- Who plays Tao Yuanming in butterfly lovers?
- What constellation male loves Aquarius female best?
- A constellation girl who will say "if you leave" carefully?
- What constellations are there in the winter night sky?
- How do Libra boys chase?