0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 12:38:47 +00:00
OI-codes/AcWing/84/84.cpp

9 lines
132 B
C++
Raw Normal View History

class Solution {
public:
int getSum(int n) {
int r = n;
n && (r += getSum(n - 1));
return r;
}
};