南阳260

 1 #include<stdio.h>
 2 int main()
 3 {
 4     int n;
 5     scanf("%d",&n);
 6     while(n--)
 7     {
 8         int m;
 9         scanf("%d",&m);
10         int temp=0,ans=0;
11         for(int i=1; i<=m; ++i)
12             {
13                 temp+=i;
14                 ans+=temp;
15             }
16         printf("%d
",ans);
17     }
18 }
原文地址:https://www.cnblogs.com/qq188380780/p/6360371.html