fork download
  1. #include <stdio.h>
  2. int factorical(int n){
  3. int i,x=1;
  4. for(i=1;i<=n;i++)
  5. {
  6. x*=i;
  7. }
  8. return x;
  9. }
  10.  
  11. int main(void) {
  12. int x,m;
  13. scanf("%d",&m);
  14. x=factorical(m);
  15. printf("%d個の中から個を取り出す組み合わせ数は、%d通りです。",m,x);
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0.01s 5280KB
stdin
5
stdout
5個の中から個を取り出す組み合わせ数は、120通りです。