为什么编译过不去
  • 板块学术版
  • 楼主2009niuniu
  • 当前回复6
  • 已保存回复6
  • 发布时间2023/7/13 08:35
  • 上次更新2023/11/3 10:12:04
查看原帖
为什么编译过不去
997261
2009niuniu楼主2023/7/13 08:35
#include<bits/stdc++.h>
using namespace std;
int N;
long long num=0;
void f1(int n)
void f2(int n)
void f1(int n)
{
    n+=1;
    if(n==N) num++;
    else if(n<N)
    {
        f1(n);
        f2(n);
    }
}
void f2(int n)
{
    n+=2;
    if(n==N) num++;
    else if(n<N)
    {
        f1(n);
        f2(n);
    }
    
}
int main()
{
    cin>>N;
    f1(0);
    f2(0);
    cout<<num;
    return 0;
}
2023/7/13 08:35
加载中...