#include<stdio.h>
int main(void)
{
int a, b, c, n;
printf("What Fibonacci number would you like?:");
scanf("%d", &n);
if (n == 0 || n == 1)
return printf("%d", n);
else
for (c = 0; c < n; c++)
{
c = a + b;
a = b;
b = c;
}
printf("%d ", c);
return 0;
Run Code Online (Sandbox Code Playgroud)
}
我已经制定了使用Fibonacci方程的程序.但是我在编译期间遇到以下错误:
Error 1 error C4700: uninitialized local variable 'a' used d:\computer programming c++\20150923\20150923\20150923-1.c 15 1 20150923
Error 2 error C4700: uninitialized local variable 'b' …Run Code Online (Sandbox Code Playgroud) c ×1