杭电oj 2050 折线分割平面 C语言
#include<stdio.h>
void main()
{
int c, n, i;
long long sum;
while (~scanf_s("%d", &c))
{
while (c--)
{
scanf_s("%d", &n); sum = 0;
sum = 2 * n * n - n + 1;
printf("%lld\n", sum);
}
}
}
#include<stdio.h>
void main()
{
int c, n, i;
long long sum;
while (~scanf_s("%d", &c))
{
while (c--)
{
scanf_s("%d", &n); sum = 0;
sum = 2 * n * n - n + 1;
printf("%lld\n", sum);
}
}
}