Fortune Telling Collection - Zodiac Guide - C language object-oriented packaging to achieve a constellation test program! Requirements: Given a date, you can judge what constellation it is and give it.
C language object-oriented packaging to achieve a constellation test program! Requirements: Given a date, you can judge what constellation it is and give it.
Create enumeration
Constellation //enum constellation {}
Write the name of 12 constellation with {}.
Create a class
Build an array of classes
Store the information of 12 constellation respectively.
Put a constellation in the class
Start date of the stone break//Example: 0220
End date int Shu Jie // 032 1
……
//Other functions
Code:
First, judge which constellation the entered date belongs to.
Then print out the information in class.
You can do it yourself.
Exercise yourself.
You can format the date.
From 0 10 1 to 123 1
int riQi
For example, enter 0228.
It means February 28th.
Use the if statement if(riQi & gt;; Shikai & Japanese weather < = Shu Jie)
- Previous article:What constellation is January 15th?
- Next article:What are the greedy constellation men?
- Related articles
- How many boys hang up at the same time, all of them are constellations who don't express their views?
- Super popular! What constellations are particularly attractive and sweet to everyone?
- In love, which constellations are possessive and don't want to be separated once they fall in love?
- 1972 What is the constellation on May 2nd?
- The twelve constellations have the highest face value _ The twelve constellations have the highest face value.
- 65438+1October 265438+1October 65438+1October 09 What are the constellations?
- Lucky bracelet with twelve constellations
- A career suitable for girls of the twelve constellations
- What does it mean to dream that you shit in the toilet?
- 12 constellation ancient wind male dynamic avatar