1 条题解

  • 0
    @ 2025-11-30 16:26:39

    C++ :

    #include<iostream>
    using namespace std;
    int f(int x)	//递归
    {
    	if (x==1) return 10;
    	else return f(x-1)+2;
    }
    int main()
    {
    	int n;
    	cin>>n;
    	cout<<f(n)<<endl;
    	return 0;
    }
    
    • 1

    信息

    ID
    1215
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    (无)
    递交数
    0
    已通过
    0
    上传者