#21134: c++


weiweitseng (Wei Wei)

School : No School
ID : 112665
IP address : [123.192.168.130]
Last Login :
2021-06-29 10:44:28
a042. 平面圓形切割 -- 許介彥 | From: [123.192.168.130] | Post Date : 2020-04-18 14:02

#include <iostream>

using namespace std;

 

int main(){

int a;

while (cin>>a){

cout<<a*(a-1)+2<<endl;

}

}

 
#26111: Re:c++


1066108@tjps.tp.edu.tw (Sunday_U_24083)

School : 臺北市立中正高級中學
ID : 145362
IP address : [112.78.73.46]
Last Login :
2021-07-22 21:37:35
a042. 平面圓形切割 -- 許介彥 | From: [180.217.30.203] | Post Date : 2021-07-16 21:56

#include

using namespace std;

 

int main(){

int a;

while (cin>>a){

cout<<a*(a-1)+2<<endl;

}

}


這算是直接代公式了

 
ZeroJudge Forum