BlueBook

p100ex4 - Cross Country

Given a two digit code, decide if the code represents either:

Code Output
MG midget girls
MB midget boys
JG junior girls
JB junior boys
SG senior girls
SB senior boys

All codes are case sensitive, and will always be two letters long. Be sure to reject invalid codes by outputting "invalid code". Also, output what each code represents, as stated exactly.

Input

Input consists of two character code representing either one of the six categories described above.

Output

Ouput the full description of the code. If the code does not exist, output "invalid code".

Sample Input

JG

Sample Output

junior girls

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 21, 2008

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

Comments (Search)

Make sure you read all the questions slowly and CAREFULLY.

I dunno if there is something wrong with my code. If else statements and stuff are acting weird. It always says invalid code.

Nvm figured it out. Can't compare string variables like that :)

can someone help me on this question i'm still struggling.

Please review your basic knowledge of C++. If you can't even write a cout statement correctly, then you shouldn't be trying to solve problems.

i am struggling

You haven't even made any submissions on this problem, so how do you expect people to help you?
This question is very straightforward.

who are you

Click on my username.
*Sigh*

I know this has nothing to do with the topic but you two go to the same school

I tried this code on ideone.com and it works. As I submit it, I get 10/30!!!
[Edit: code removed by admin]

Hey Aryan,
You have 2 problems with your code.
No. 1: Your curly brackets are in the wrong places.
I wont give you any examples, that would be cheating.
Also, you made a small typo. Hint: Read the question!

you are not suppose to post your code here.
people who have solved the problem can look at your submission and help you.

Waiting for other submissions to finish...
it just says this

You were submitting during the contest so there were a lot of submissions being made to the grader which slows it down. It gets graded eventually it just takes a few minutes. Now that the contest's over it should be back to normal.

To me, it looks like a VERY easy question. Is there a catch?

No. BlueBook questions (those in the BlueBook category, and generally having problem codes of p\d+ex\d+), are exercises from an introductory CS textbook.

There may be a catch... still looks too easy