标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7725 Accepted Submission(s): 4558
1 #include <stdio.h> 2 int math(int n) 3 { 4 __int64 i, j, sum = 1, total = 1, con = 1 ; 5 for(i=n-1, j=1; i>=1; j++, i-- ) 6 { 7 total *= i ; sum *= j ; 8 con += total/sum *(j+1) ; 9 } 10 return con ; 11 } 12 int main() 13 { 14 int n, m ; 15 scanf("%d", &n) ; 16 while(n--) 17 { 18 scanf("%d", &m) ; 19 int con = math(m) ; 20 printf("%d\n", con) ; 21 } 22 return 0 ; 23 }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4668183.html