首页 > 其他分享 >Acing 3643

Acing 3643

时间:2023-02-14 18:01:55浏览次数:47  
标签:std return int func 3643 Acing

#include <iostream>
using namespace std;
int func(int n){
    if(n==0) return 1;
    if(n==1) return 1;
    if(n==2) return 2;
    return func(n-1) + func (n-2) + func(n-3);
}
int main(){
    int n = 0;
    cin>>n;
    int res = func(n);
    cout<<res<<endl;
    return 0;
}

标签:std,return,int,func,3643,Acing
From: https://www.cnblogs.com/poteitoutou/p/17120444.html

相关文章