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

輸入說明 :
none
輸出說明 :
none
範例輸入 :
3
4
範例輸出 :
8
14
程式碼 :
#include <stdio.h>
int main()
{
int n;
while(scanf("%d",&n)==1)
printf("%d\n",n*n-n+2);
return 0;
}
http://zerojudge.tw/ShowProblem?problemid=a042
沒有留言:
張貼留言