Cancer or Scorpio
Time Limit: 1 Sec Memory Limit: 256 MB
题目连接
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3098
Description
Alice and Michael is a young couple who are planning on having their first child. Their wish their son Nelson was born on a special date for both of them.
Alice has investigated in the internet and has found that the period of gestation is forty weeks. These forty weeks begin to count on the first day of the last menstrual cycle.
Michael is passionate about astrology and even more about the zodiac signs, he has asked Alice to investigate the range of dates that correspond to each sign.
Sign |
Begin |
End |
Aquarius |
January, 21 |
February, 19 |
Pisces |
February, 20 |
March, 20 |
Aries |
March, 21 |
April, 20 |
Taurus |
April, 21 |
May, 21 |
Gemini |
May, 22 |
June, 21 |
Cancer |
June, 22 |
July, 22 |
Leo |
July, 23 |
August, 21 |
Virgo |
August, 22 |
September, 23 |
Libra |
September, 24 |
October, 23 |
Scorpio |
October, 24 |
November, 22 |
Sagittarius |
November, 23 |
December, 22 |
Capricorn |
December, 23 |
January, 20 |
Alice and Michael ask for help to calculate the date of birth of their son Nelson and his zodiac sign.
Input
The first line of input contains a single integer N, ( 1N1000) which is the number of datasets that follow.
Each dataset consists of a single line of input that contains only eight digits that represent the date of the first day of the last menstrual cycle in format MMDDYYYY.
Output
For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, the date of birth in format MM/DD/YYYY, a space, and the name (in lowercase) of zodiac sign that correspond according to the date of birth.
Note: Considers leap years.
Sample Input
Sample Output
1 10/30/2009 scorpio 2 10/29/2008 scorpio
HINT
题意
啊,有个妹子怀孕了,怀孕40周,然后问你这个孩子什么时候出生,出生后的星座是啥
题解:
啊,这个40周是什么鬼啊,我跑了一下样例,发现应该是271天,于是我就改成271,结果一发就交过了……
这道题真是迷啊
代码:
//qscqesze
#include
#include
#include
#include
#include
#include
#include <set>
#include
#include
#include
#include
#include
#include