CCC '15 J1 - Special Day

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 256M

Problem type
Canadian Computing Competition: 2015 Stage 1, Junior #1

February 18 is a special date for the CCC this year.

Write a program that asks the user for a numerical month and numerical day of the month and then determines whether that date occurs before, after, or on February 18.

• If the date occurs before February 18, output the word Before.
• If the date occurs after February 18, output the word After.
• If the date is February 18, output the word Special.

Input Specification

The input consists of two integers each on a separate line. These integers represent a date in .

The first line will contain the month, which will be an integer in the range from (indicating January) to (indicating December).

The second line will contain the day of the month, which will be an integer in the range from to . You can assume that the day of the month will be valid for the given month.

Output Specification

Exactly one of Before, After, or Special will be printed on one line.

Sample Input 1

1
7

Output for Sample Input 1

Before

Sample Input 2

8
31

Output for Sample Input 2

After

Sample Input 3

2
18

Output for Sample Input 3

Special

• commented on Jan. 20, 2023, 7:49 a.m.

Hmm i just name error, im sure i spelled correctly.

• commented on Sept. 19, 2022, 3:58 a.m. edit 2

I passed all except case #6. I think it is because I am not able to get the "Special" output. I am sure I am missing something obvious.

Edit: I figured it out!

• commented on Jan. 31, 2022, 5:47 p.m.

took me a lot longer than i thought it would. Make sure to include the instance where the month is feb and the day is less than the 18th and when it is feb and higher than 18th.

• commented on Aug. 20, 2021, 9:14 a.m.

WE need to handle the case for the feb month as well, before and after..

• commented on Aug. 23, 2019, 1:25 a.m.

What's wrong with my solution

• commented on Aug. 23, 2019, 10:30 a.m.

Try this case

3
6
• commented on Oct. 28, 2018, 12:38 p.m.

Didn't even realize the outputs had to be capitalized.

• commented on Aug. 29, 2018, 8:56 a.m.

This comment is hidden due to too much negative feedback. Show it anyway.

• commented on Dec. 13, 2018, 1:26 p.m.

@12weareunited You put an else statement without referencing an if statement first. The answer is in the error: else without if.