Fortune Telling Collection - Zodiac Analysis - Using java to write a program, you can judge the user's constellation by the birthday entered by the user. Ask the great gods to give some hints or ideas. It is stipulated that this method cannot be c
Using java to write a program, you can judge the user's constellation by the birthday entered by the user. Ask the great gods to give some hints or ideas. It is stipulated that this method cannot be c
Public? Static electricity Invalid? main(String[]? args)? {
int? Point? =? - 1;
String[]? str? =? {Aries, Taurus, Gemini, Cancer, Lion, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius and Pisces};
SimpleDateFormat? sdf? =? New? simple date format(" MM-DD ");
System.out.println ("Please enter the date in MM-dd format, for example: 8-9");
Scanner? Scanning? =? New? Scanner (system. in);
Dating? d? =? null
What time? (really)? {
Try it? {
String? Input? =? scan . next();
d? =? Sdf.parse (input);
Break;
}? Catch? (exception? ex)? {
System.out.println ("Please enter the correct date format, for example: 08-09");
}
}
//Format the date and convert it into * *. * * format, such as 65438+ 10 month 1 converted to 1.0 1.
Double? Dating? =? Double.parseDouble((d.getMonth()? +? 1)
+? "."? +? String.format("%02d ",d . getdate()));
What if? (3.2 1? & lt=? Dating? & amp& amp? 4. 19? & gt=? Date)? {
Point? =? 0;
}? Or what? What if? (4.20? & lt=? Dating? & amp& amp? 5.20? & gt=? Date)? {
Point? =? 1;
}? Or what? What if? (5.2 1? & lt=? Dating? & amp& amp? 6.2 1? & gt=? Date)? {
Point? =? 2;
}? Or what? What if? (6.22? & lt=? Dating? & amp& amp? 7.22? & gt=? Date)? {
Point? =? 3;
}? Or what? What if? (7.23? & lt=? Dating? & amp& amp? 8.22? & gt=? Date)? {
Point? =? 4;
}? Or what? What if? (8.23? & lt=? Dating? & amp& amp? 9.22? & gt=? Date)? {
Point? =? 5;
}? Or what? What if? (9.23? & lt=? Dating? & amp& amp? 10.23? & gt=? Date)? {
Point? =? 6;
}? Or what? What if? ( 10.24? & lt=? Dating? & amp& amp? 1 1.22? & gt=? Date)? {
Point? =? 7;
}? Or what? What if? ( 1 1.23? & lt=? Dating? & amp& amp? 12.2 1? & gt=? Date)? {
Point? =? 8;
}? Or what? What if? ( 12.22? & lt=? Dating? & amp& amp? 12.3 1? & gt=? Date)? {
Point? =? 9;
}? Or what? What if? ( 1.0 1? & lt=? Dating? & amp& amp? 1. 19? & gt=? Date)? {
Point? =? 9;
}? Or what? What if? ( 1.20? & lt=? Dating? & amp& amp? 2. 18? & gt=? Date)? {
Point? =? 10;
}? Or what? What if? (2. 19? & lt=? Dating? & amp& amp? 3.20? & gt=? Date)? {
Point? =? 1 1;
}
If (point? ==? - 1)? {
System.out.println ("You really come from the earth ..."); Return;
}
system . out . println(string . format(
"Found it! o^? O, your sign is% S? str[point]));
- Related articles
- What color do the zodiac like?
- Ask for some classic Japanese girl cartoons.
- Favorite constellation girl
- Which three constellations are stubborn and unyielding, and the more frustrated and brave they are, which three are invincible Xiao Qiang?
- What test sites are there in ACCA?
- How does the Japanese constellation hand rope wind the thread into an X shape on the scroll?
- Who wants information about One Piece? Members other than Luffy
- Many people believe in constellations. Is it true?/You don't say.
- 1995 was born at 8: 30 in the morning in August of the lunar calendar 17. What are the rising signs and the moon signs?
- 12 What are the kissing methods of male in constellation?