标签:style blog io color os sp for 数据 div
1 #include <stdio.h> 2 3 int sum(int n); 4 5 int main(){ 6 int T; 7 int n; 8 int i; 9 int result; 10 11 scanf("%d",&T); 12 13 while(T--){ 14 scanf("%d",&n); 15 16 result=0; 17 for(i=1;i<=n;i++) 18 result+=sum(i); 19 20 printf("%d\n",result); 21 } 22 return 0; 23 } 24 25 int sum(int n){ 26 int i; 27 int result; 28 29 result=0; 30 for(i=1;i<=n;i++) 31 result+=i; 32 33 return result; 34 }
标签:style blog io color os sp for 数据 div
原文地址:http://www.cnblogs.com/zqxLonely/p/4098294.html