//指针 #include <bits/stdc++.h> using namespace std; int sum(int *a){ int b=*a-1,c=*a-2; if(*a<=2){ return 1; }else{ return sum(&b)+sum(&c); } } int main(){ int x,a; cin>>a; x=sum(&a); cout<<x; return 0; }
标签:数列,int,sum,斐波,那契,指针 From: https://www.cnblogs.com/w6826301/p/17795507.html