题库练习 阅读程序填写结果:#include<cstdio>

A65985 | 阅读程序填写结果:#include<cstdio>

来源2022年
时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

阅读程序填写结果:

#include<cstdio>
#include<iostream>
using namespace std;
int fun(int x)
{
    if(x==0 || x==1)
        return 3;
    else 
        return x+fun(x-2);
}
int main()
{
    int k;
    cin>>k;
        printf("%d", fun(k));
    return 0;
}

题号

第1题

第2题

第3题

输入数据

1

3

9

输出数据




C++ 编辑器
输入
输出