用遞迴算出來 an = (n^2-n)/2+1
#include <iostream>using namespace std;int main(){ int n=0; while(cin >> n) { cout << (n*n-n)/2+1 << endl; } return 0;}