版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Dragon_fxl/article/details/55113224
#include <stdio.h>
int main(void) {
int n;
while(~scanf("%d", &n))
printf("%d\n\n", n % 2 ? (n + 1) / 2 * n : n / 2 * (n + 1));
return 0;
}