想看題目請點我
#include<iostream>
using namespace std;
int cut(int n)
{
if(n==1) return 2;
else return cut(n-1)+((n*n-n+2)/2);
}
int main(void)
{
int n;
while(cin>>n){
cout << cut(n) << endl ;
}
return 0;
}這題可能有很多人有看沒有懂 ,
包括小弟啦... ,
提供一個pdf講解下載位置 ,
請點我
看第二部分的平面空間就會明白題目在說什麼了 ^^