Exercises and problems in Informatics
I. 40. Every row, column and both main
diagonals of the square in the figure contain a prime number
with five digits when rows and the diagonals are read from left to
right, and columns from top to bottom. Moreover,
the sum of the digits of the prime numbers must be the same,
the digit in the top left corner is given in advance,
any prime number can be re-used in the actual square and
a prime number can not have any zero leading digit, that is,
for example, 00003 is not a prime number with five digits.
| 1 || 1 || 3 || 5 || 1 |
| 3 || 3 || 2 || 0 || 3 |
| 3 || 0 || 3 || 2 || 3 |
| 1 || 4 || 0 || 3 || 3 |
| 3 || 3 || 3 || 1 || 1 |
Your program (I40.pas, ...) should read the sum of
the digits of the prime numbers, further the digit to be placed into
the top left corner, then display the corresponding square.
In the example, the sum of the digits=11,
while the top left digit=1.
I. 41. A square is divided into smaller
light or dark squares. We can obtain different figures by rotating the
original square or reflecting it around its axes of
symmetry. (However, it may happen that some transformations, or
combination of transformations produce the same - possibly the
original - figure.)
Write your program (I41.pas, ...) which reads the
colouring of the NxN square using the symbols V
(=light) and S (=dark), successively representing in each row
the colours of the small squares, then displays the square together
with all different images under all combinations of
The example shows for N=3 the
original square=((S,S,V),(V,V,V),(V,S,S)) and all possible
images under the transformations.
I. 42. The exchange rates between 100 units
of some foreign currency and HUF (=Ft) are stored in a table. For
example, 100 AUD is worth 13279 HUF.
Prepare a sheet (I42.xls) which - using a
fixed table of foreign currency - computes all the exchange rates
in the fourth column if any amount of a single (but arbitrary)
currency in the third column has been entered.
See the examples.
| || || || |
| || || || |
Send your solutions to the following e-mail address:
Deadline: 13 February 2003