請(qǐng)問(wèn)下面函數(shù)為什么提示錯(cuò)誤:使用了未初始化的局部變量“c”#include "stdafx.h"#includeusing namespace std;int fib(int n);int main(){int k = fib(10);cout << "k=:" << k;return 0;}int fib(int n) {int c;if (n ==1||c == 2 )c = 1;if (n > 2)c = fib(n - 1) + fib(n - 2);else0;return c;}
C++編程問(wèn)題請(qǐng)大神賜教謝謝
蠱毒傳說(shuō)
2018-07-11 14:19:25