http://acm.hit.edu.cn/hoj/problem/view?id=1995
把N=4画一下结果就出来了
fn=n^2-n+2
N=0时有空集 要输出1
#include <stdio.h>
int main()
{
int cases, n, fn;
scanf("%d", &cases);
while (cases--)
{
scanf("%d", &n);
if (n == 0)
printf("%d\n", 1);
else
{
fn = n * n - n + 2;
printf("%d\n", fn);
}
}
return 0;
}