0% found this document useful (0 votes)
13 views1 page

2013_c_2_jr_sol

The document contains solutions to the American Computer Science League Junior Division Contest #2 for 2012-2013. It includes problems related to prefix/infix/postfix expressions, bit-string operations, and a program that counts specific even numbers. Each problem is followed by its solution and explanation.

Uploaded by

CK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

2013_c_2_jr_sol

The document contains solutions to the American Computer Science League Junior Division Contest #2 for 2012-2013. It includes problems related to prefix/infix/postfix expressions, bit-string operations, and a program that counts specific even numbers. Each problem is followed by its solution and explanation.

Uploaded by

CK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

ACSL

2012 - 2013 American Computer Science League Contest #2


Junior Division Solutions

1. Prefix/Infix/Postfix 1. 4
+ /+ 2 4 3 / * 4 + / 6 2 1 8 = + /(2 + 4) 3 / * 4 +(6 / 2) 1 8 = + / 6 3 / * 4 + 3 1 8
= +(6 / 3) / * 4 (3 + 1) 8 = + 2 / * 4 4 8 = + 2 / (4 * 4) 8 = + 2 / 16 8
= + 2 (16 / 8) = + 2 2 = 2 + 2 = 4

2. Prefix/Infix/Postfix 2. AB+C/CAB─*BC+/+
A + B + C*(A – B) = A B + C / C A B ─ * B C + /+
C B+C

3. Bit-String Flicking 3. 00000


(NOT (01101 OR 01011)) AND ( 01101 OR 00101)
= ( NOT 01111) AND 01101
= 10000 AND 01101
= 00000

4. Bit-String Flicking 4. 11000


(LCIRC-2 (RSHIFT – 1 (RCIRC – 1 (LSHIFT – 1 01101))))
= (LCIRC-2 (RSHIFT – 1 (RCIRC – 1 11010)))
= (LCIRC-2 (RSHIFT – 1 01101))
= (LCIRC-2 00110)
= 11000

5. 25
5. What Does This Program Do?
This program finds and counts the even numbers from 100 to 200 that are
divisible by 3 (150) and divisible by 5 (91) and then eliminates those
divisible by both (30).

You might also like