のむログ

技術メモ / 車 / 音楽 / 雑記 / etc...

こちらは旧ブログになります。

新ブログはこちらに移行しました🙇

再帰関数

【C/C++】簡単な再帰関数の動作について考えてみる

関数の宣言方法 まず基本となる関数の宣言方法から。関数を使うためにはプロトタイプ宣言をしなければいけません。 #include <stdio.h> int Rec( int n ); // プロトタイプ宣言 int main ( void ) { // 処理 return 0; } プロトタイプ宣言はたくさんの関数が出てきた</stdio.h>…

Recursive functions for people who can not program

Introduction How to declare functions Recursive function Factorial Fibonacci sequence Conclusion Introduction The school's lesson has followed the C language. It seems difficult for everyone else's department to learn, so I’ll write a hint…