2015 Canadian Computing Competition, Stage 1

Problem J1: Special Day

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

The input consists of two integers each on a separate line. These integers represent a date in 2015.
The first line will contain the month, which will be an integer in the range from 1 (indicating January) to 12 (indicating December).
The second line will contain the day of the month, which will be an integer in the range from 1 to 31. You can assume that the day of the month will be valid for the given month.

Output

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

Sample Input 1

1
7

Sample Output 1

Before

Sample Input 2

8
31

Sample Output 2

After

Sample Input 3

2
18

Sample Output 3

Special

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Feb 21, 2015

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

What if the month was bigger but the day was smaller?

Wait now I understand

You have to have ur inputs as (raw_input ()) for this problem. Variable=input() will not work here

Can anyone tell me what is wrong with my code? I simply do not understand.confused.gif

Thanks!


um no one helped you

I only get 40/90, but my code passes on ideone. What's wrong?

Your missing an if-statement. Read the question carefully and think of EVERY possibility. Ironically, I made the same mistake! Its OK.

My code runs fine on my computer but always has "Error: Could not fin" when I enter it on wcipeg. Could someone please help?

Thanks

You misspelled the problem code; there are 3 c's.

Quite the same to Venkat24's problem, but even as I changed the elifs to ifs, the code is simply not working on Peg Judge. I am sure that I have done everything right. This question also seems pretty straight forward. Is this my mistake? Or is it something with repl.it that is causing this?

Thanks for your time.

Your logic is simply wrong. What if the day is March 14? This compares as > 2 for day, and < 18 for month, which isn't covered by any of your if statements.

on my code it works perfectly on ideone but here it gets 70/90. Can anyone help me?

Have you tested the sample inputs? Please make sure your code works for those. Just because your code works for some test cases it doesn't mean it works for all.

Thanks! I just needed to change everything from elif to ifs!