题解 | #牛牛的西格玛#
牛牛的西格玛
http://www.nowcoder.com/practice/c6b750ee8853484f8dbf14b9531b501f
long long output(int n) {
return n == 1 ? n : n + output(n - 1);
}
int main() {
int n;
scanf("%d", &n);
printf("%lld", output(n));
return 0;
}