标签:io for 问题 amp return print include main
#include<stdio.h>
int main()
{
int n,m;
int sum,i;
int a[21];
int t=1,t1=1;
for(i=1;i<21;i=i+2)
{
a[i]=t*t1;
a[i+1]=a[i];
t=t1*t;
t1=t1+2;
}
scanf("%d",&n);
while(n--)
{
sum=0;
scanf("%d",&m);
for(i=1;i<=m;i++)
{
sum+=a[i];
}
printf("%d\n",sum);
}
return 0;
}
标签:io for 问题 amp return print include main
原文地址:http://www.cnblogs.com/qq11/p/3873275.html