Assignment 3 CSS 105
Assignment 3 CSS 105
Assignment 3
4) There are two boxes. Size of the first box is A1 × B1 × C1, size of the second box is A2
× B2 × C2. Find out whether it is possible to put one of these boxes into the other if you
can rotate a box around any edge by 90 degrees.
The first line of input contains three integers A1, B1, C1 (1 ≤ A1, B1, C1 ≤ 1000). The
second line contains three integers A2, B2, C2 (1 ≤ A2, B2, C2 ≤ 1000).
If the boxes are equal, output "Boxes are equal". If the first box can be placed into
the second one, output "The first box is smaller than the second one". If the second box
can be placed into the first one, output "The first box is larger than the second one".
Otherwise, output "Boxes are incomparable".
Input : 1 2 3
321
Output: Boxes are equal
5) You are given a sequence consisting only of the characters '>', '<' and '-'. Find out the
number of arrows hidden in this sequence. Arrows are substrings of the form '>>-->' and
'<--<<'.
The first line of input contains no more than 250 characters '>', '<' and '-' without
spaces. The first line may or may not end with newline character(s).
Output one integer equal to the number of arrows.
Input : <<<<>>--><--<<--<<>>>--><<<<<
Output: 4