解题思路:
注意事项:
参考代码:
#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 人评分
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:640 |
【蟠桃记】 (C语言代码)浏览:689 |
C语言程序设计教程(第三版)课后习题6.5 (C++代码)浏览:481 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:753 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:646 |
IP判断 (C语言描述,蓝桥杯)浏览:1108 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:326 |
时间转换 (C语言代码)浏览:685 |
输入输出格式练习 (C语言代码)浏览:765 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:687 |