原题链接
数学题,找规律,套公式。
#include <stdio.h> int main(){ int n; while(scanf("%d", &n) == 1){ if(n & 1) --n; printf("%d\n", n * (2 + n) / 4); } return 0; }