IOM 2019, Блиц — Задача 40

OLYMPIAD OF METROPOLISES, Moscow, September 2, 2019 · 2 септември 2019 г.

Условие

Determine the output of the following program.

Java listing, 8 numbered lines: main prints Math.max(what('180', 3), what('AB', 2)); the recursive method what(String str, int n) returns str.charAt(0) - '0' when n == 1 and otherwise 10 * what(str, n - 1) + str.charAt(n - 1) - '0'.

Решение

Внимание: Непълно решение

В архива няма официално решение на тази задача.


Оригинал в Архива: blitz-en-all-task-final.pdf