ACSL
2012 - 2013 American Computer Science League Contest #2
Junior Division
1. Prefix/Infix/Postfix
Evaluate the following prefix expression if all numbers are single
digits:
+ /+ 2 4 3 / * 4 + / 6 2 1 8
2. Prefix/Infix/Postfix
Convert the infix expression to a postfix expression.
A + B + C*(A – B)
C B+C
3. Bit-String Flicking
Evaluate the following expression:
(NOT (01101 OR 01011)) AND ( 01101 OR 00101)
4. Bit-String Flicking
Evaluate the following expression:
(LCIRC-2 (RSHIFT – 1 (RCIRC – 1 (LSHIFT – 1 01101))))
5. What Does This Program Do?
What is printed when this program is executed?
Z=0
FOR N = 100 TO 200 STEP 2
IF (N/3) = INT(N/3) THEN Z = Z + 1
IF (N/5) = INT(N/5) THEN Z = Z + 1
IF N/3 = INT(N/3) AND N/5 = INT(N/5) THEN Z=Z-1
NEXT N
PRINT Z
END