Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
169 | Benson | 年龄问题 | C++ | Wrong Answer | 0 MS | 260 KB | 291 | 2022-07-21 10:52:37 |
#include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; int age(int x) { if(x==1) { return 10; } else { return age(x-1)+2; } } int main(){ int n; cin>>n; cout<<age(n); return 0; }
------Input------
0
------Answer-----
18
------Your output-----
8