题解(不用数组和递归)
2025-08-10 18:18:17
发布于:江苏
3阅读
0回复
0点赞
AC代码
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
int a = 1, b = 0, c;
for (int i = 2; i <= n; i++) {
c = a + b;
b = a;
a = c;
}
printf("%d", c);
return 0;
}
这里空空如也
有帮助,赞一个