1 solutions
-
0
这是一个函数式交互题的实例,众所周知,茴香豆的茴字可以有多种写法。
第一种就是正常的返回
a + b
就行了。#include "plus.h" int add(int a, int b) { return a + b; }
本题也给了
inc
和dec
,我们也可以进行一下各种各样的测试,比如以下内容:#include "plus.h" int add(int a, int b) { return inc(a) + dec(b); }
#include "plus.h" int add(int a, int b) { return dec(inc(a + b)); }
- 1
Information
- ID
- 19
- Time
- 1000ms
- Memory
- 512MiB
- Difficulty
- 1
- Tags
- # Submissions
- 11
- Accepted
- 7
- Uploaded By