2007 Canadian Computing Competition, Stage 1

Problem J1: Who is in the Middle?

In the story Goldilocks and the Three Bears, each bear had a bowl of porridge to eat while sitting at his/her favourite chair. What the story didn’t tell us is that Goldilocks moved the bowls around on the table, so the bowls were not at the right seats anymore. The bowls can be sorted by weight with the lightest bowl being the Baby Bear’s bowl, the medium bowl being the Mama Bear’s bowl and the heaviest bowl being the Papa Bear’s bowl.

Write a program that reads in three weights and prints out the weight of Mama Bear’s bowl. You may assume all weights are positive integers less than 100.

Sample Input

10
5
8

Sample Output

8

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 29, 2008

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

Comments (Search)

Arrays.sort(arrayName);

When i input my code in ideone, it says
if a <= b <= c or c <= b <= a:
^
IndentationError: unindent does not match any outer indentation level

Ive submit my code so admin can help. But what does it mean?

Did you mix tabs and spaces in your code? python interprets them as different indentations, so pick one to use only. Also just as a tip, if the problem tells you that the input will have integers less than 100, then you do NOT have to check for that yourself, the statement doesn't lie(at least not intentionally :) ). It simply helps you in knowing the size of the input.

i changed it, but i still dont understand what you mean

it still keeps on saying the same thing about indentation even though i use one kind of indentation. can i see my error?

May i please see my code? (i asked nicely this time)

I mean error? (wow i fail)

Well, did you try running this on your computer before submitting to the judge? There's a glaring syntax error on the last line.

can we use sorting in this question?

You can use anything other than plagiarism.