A
UBB · Informatică
157

Se consideră algoritmul M(n, i, j), unde n, i și j sunt numere naturale (1n,i,j1041 \le n, i, j \le 10^4).

Algoritm 1

Algorithm M(n, i, j)
  If i > j then
    Write '@'
  Else
    If (i * j) MOD n = 0 then
      M(n, i + 3, j − 2)
      Write 'P'
    Else
      If (i + j) MOD n = 1 then
        M(n, i, j − 1)
        Write 'Q'
      Else
        M(n, i + 1, j)
        Write 'R'
      EndIf
    EndIf
  EndIf
EndAlgorithm

Ce afișează execuția apelului M(15, 2, 10)?

7 / 37