CE贝多芬


私信TA

用户名:hjl88

访问量:7945

签 名:

等  级
排  名 56
经  验 11118
参赛次数 20
文章发表 293
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include<iostream>

#include<string.h>

#include<ctype.h>

#include<math.h>

using namespace std;

int f(int x);

int main()

{

    int n;

    cin>>n;

    cout<<f(n)<<endl;

    return 0;

}

int f(int x)

{

    if(x == 1)

    return 10;

    else if(x>1)

        return f(x-1)+2;

}


 

0.0分

0 人评分

  评论区

  • «
  • »