私信TA
用户名:Month
访问量:9477
签 名:
心里有座坟,住着未死人!
自我简介:
作者: 月雨果 发表时间:2019-03-19 20:37:08 浏览:1123 | 评论:0
解题思路: 如果不调用函数,会很难实现效果。参考代码:
#include <stdio.h>
int f(int x)
{
if(x == 1)
return 10;
else if(x>1)
return f(x-1)+2;
}
int main()
int x;
scanf("%d",&x);
printf("%d\n",f(x));
return 0;
0.0分
4 人评分
看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:
编程语言转换万能编程问答
代码解释器
代码纠错
SQL生成与解释