题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1249
part=3*s*(s-1)+2
1 #include<stdio.h> 2 #include<math.h> 3 main() 4 { 5 int n,s,i,p,m; 6 while(~scanf("%d",&n)) 7 { 8 for(i=1;i<=n;i++) 9 { 10 scanf("%d",&s); 11 p=3*(s-1)*s + 2; 12 printf("%d ",p); 13 } 14 } 15 }