第十一题
3-10难度系数1 sum (5分)
第一道英文题
欸,还蛮简单的
直接放代码
#include<iostream>
using namespace std;
int f(int x){
if(x == 0)
return 0;
else
return x + f(x - 1);
}
int main(){
int inp;
cin >> inp ;
cout << f(inp);
}
提交结果