为何不过

hebaijun 2024-10-23 19:58:52 1

#include<bits/stdc++.h> using namespace std; int main(){ freopen("A.in","r",stdin); freopen("A.out","w",stdout); int n,a[50]; cin>>n; a[1]=1; a[2]=2; a[3]=4; for(int i=4;i<=50;i++){ a[i]=a[i-1]+a[i-2]+a[i-3]; } cout<<a[n]; return 0; }

{{ vote && vote.total.up }}