2015-12-10 20 views

回答

1

在java中,這將是

double pent = n * (3.0 * n - 1.0)/2.0;