#include<stdio.h> int main() { int n,b; int f(int x); scanf("%d",n); b=f(n); printf("%d",b); return 0; } int f(int x) { if(x==1) return 0; else if(x==2) return 1; return f(x-1)+f(x-2); }
扫描二维码,关注牛客
下载牛客APP,随时随地刷题
全部评论
(7) 回帖