10079

估计这是这章里最水的一道题了吧,在纸上画画就知道,每多一次切割,最多的方案就是把这条线切割之前的每条线,

就是个等差数列求和。

//============================================================================
// Name        : 10079.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
using namespace std;

long long n;

int main() {
	while(scanf("%lld", &n)&&n >= 0){
		printf("%lld\n", n*(n+1)/2+1);
	}
	return 0;
}

posted @ 2011-05-27 22:03  KOKO's  阅读(451)  评论(0编辑  收藏  举报