は(インデントを気に)それがどのように動作するかです:
mystery6 is called with 5, 5 != 0 so it calls itself with 4
mystery6 is called with 4, 4!= 0 so it calls itself with 3
mystery6 is called with 3, 3 != 0 so it calls itself with 2
mystery6 is called with 2, 2 != 0 so it calls itself with 1
mystery6 is called with 1, 1 != 0 so it calls itself with 0
mystery6 is called with 0, 0 == 0 so it returns
mystery6 call with 1 is returned, it prints 1
mystery6 call with 2 is returned, it prints 2
mystery6 call with 3 is returned, it prints 3
mystery6 call with 4 is returned, it prints 4
mystery6 call with 5 is returned, it prints 5
謎は何ですか?別の出力を期待しましたか? – shmosel
あなたには新しいので、私はあなたに書いています。 @shmoselが示唆しているように、あなたはあなたが何を期待しているかを示していません。あなたは何をすべきか知っていますか?それはプログラミングの技術を学ぶために必要な部分です。あなたのプログラムが行ごとに行うことに従い、変数の内容を紙に記録し、印刷されるものを順番に表示します。あなたはすぐにあなた自身の答えを見なければなりません。 –
コードが混乱している場合は、デバッガを使って最初に試してみてください。私は[小さなプログラムをデバッグする方法](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/)を読むことをお勧めします。 – EJoshuaS