return is the determinant of whether a program is recursive or not

When I was doing the question today, I suddenly discovered a very interesting phenomenon. Without further ado, let’s start with the picture:

The above is the recursive case, the program has waited for a long time without output. In fact, the recursive program will not end because it has no end sign.

This one is a non-recursive case, and a return is added. The output shown below indicates that the program has finished execution. This return indicates that the program has returned the result, and the above program does not have a recursive case of return, the program has been recursive, but there is no end sign.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325257293&siteId=291194637