Олимпиадный тренинг

Задача . 33737


Задача

Темы:
Consider the following method.
// precondition: x >= 0
public void mystery(int x)
{
    if ((x / 10) != 0)
    {
        mystery(x / 10);
    }
    System.out.print(x % 10);
}
 
Which of the following is printed as a result of the call mystery(123456)?

A) 16
B) 56
C) 123456
D) 654321
E) Many digits are printed due to infinite recursion
 
Статистика успешных решений по компиляторам
Комментарий учителя