C++实现斐波那契数列_C语言

#include <iostream> 
using namespace std;

int main(){
	int n,arr[101];
	cin >> n;
	
	arr[1] = 1,arr[2] = 1;
	for (int i = 3;i <= n;i ++){
		arr[i] = arr[i - 1] + arr[i - 2];
	}
	cout << arr[n] << endl;
	return 0;
}