齐肯多夫是说 任何自然数都可以由不连续的斐波那契数加和得到 问如题
#include <iostream>
using namespace std;
int largestFib(int n){
if(n==0||n==1){
return n;
}
int a=0;
int b=1;
int c=1;
while(c<=n){
a=b;
b=c;
c=a+b;
}
return b;
}
int main(){
int n;
cin>>n;
while(n>0){
int tempn=largestFib(n);
cout<<tempn<<" ";
n=n-tempn;
}
}