标签:
#include <stdio.h> int main(void) { int n; int i = 0; while(1) { if(scanf("%d", &n) != EOF) { /* if(i != 0) printf("\n"); i++; */ } else break; if(n % 2) printf("%d\n\n", (n + 1) / 2 * n); else printf("%d\n\n", n / 2 * (n + 1)); } return 0; }
标签:
原文地址:http://www.cnblogs.com/mylinuxer/p/4325423.html