标签:des style blog http io color ar sp for
1 #include <stdio.h> 2 3 int jieCheng(int number); 4 5 int main(){ 6 int T; 7 char c; 8 int n; 9 int m; 10 int n_jieCheng; 11 int m_jieCheng; 12 int n_m_jieCheng; 13 int result; 14 15 scanf("%d",&T); 16 17 while(T--){ 18 getchar(); 19 20 scanf("%c%d%d",&c,&n,&m); 21 22 n_jieCheng=jieCheng(n); 23 m_jieCheng=jieCheng(m); 24 n_m_jieCheng=jieCheng(n-m); 25 26 if(c==‘A‘) 27 result=n_jieCheng/n_m_jieCheng; 28 29 else 30 result=n_jieCheng/(m_jieCheng*n_m_jieCheng); 31 32 printf("%d\n",result); 33 } 34 return 0; 35 } 36 37 int jieCheng(int number){ 38 int result; 39 int i; 40 41 result=1; 42 43 for(i=1;i<=number;i++) 44 result*=i; 45 46 return result; 47 }
标签:des style blog http io color ar sp for
原文地址:http://www.cnblogs.com/zqxLonely/p/4085910.html