1 <span class="kw4">int</span> ackermann<span class="br0">(</span><span class="kw4">int</span> m<span class="sy0">,</span> <span class="kw4">int</span> n<span class="br0">)</span>
2 <span class="br0">{</span>
3 <span class="kw1">if</span><span class="br0">(</span><span class="sy0">!</span>m<span class="br0">)</span> <span class="kw1">return</span> n <span class="sy0">+</span> <span class="nu0">1</span><span class="sy0">;</span>
4 <span class="kw1">if</span><span class="br0">(</span><span class="sy0">!</span>n<span class="br0">)</span> <span class="kw1">return</span> ackermann<span class="br0">(</span>m <span class="sy0">-</span> 1<span class="sy0">,</span> 1<span class="br0">)</span><span class="sy0">;</span>
5 <span class="kw1">return</span> ackermann<span class="br0">(</span>m <span class="sy0">-</span> 1<span class="sy0">,</span> ackermann<span class="br0">(</span>m<span class="sy0">,</span> n <span class="sy0">-</span> 1<span class="br0">)</span><span class="br0">)</span><span class="sy0">;</span>
6 <span class="br0">}</span>