#P0163. [模板] 函数题(Leetcode version)
[模板] 函数题(Leetcode version)
Background
你需要编写一个普通的函数结合给定代码解决问题。
例如,本题目要求你写一个名为add的函数解决A + B Problem。
Description
现在给出基本框架,请直接按照框架书写。
额外评测文件:
#include "foo.cc"
#include <iostream>
using namespace std;
int main() {
Solution s;
int a, b;
cin >> a >> b;
cout << s.add(a, b) << endl;
return 0;
}
你需要书写的函数文件框架:
class Solution {
public:
int add(int a, int b) {
//在此处完成你的函数
}
};
Related
In following homework: