Problem Description

對任意正整數n,平面上的n 個圓最多可將平面切成幾個區域?

Input Format

none

Output Format


none

Sample Input

3
4

Sample Output

8
14


-----*Problem from【ZeroJudge, An Online Judge System For Beginners

 

My Answer

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
#include<iostream>
using namespace std;
int main(void)
{
   int n;
   while(cin>>n){
      cout<<n*n-n+2<<endl;
   }
   return 0;
}


 


arrow
arrow
    全站熱搜

    兔老大 發表在 痞客邦 留言(0) 人氣()