Advertisement
iamos

combination.c (skeleton)

Apr 9th, 2015
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int comb(int, int);
  5.  
  6. int main(int argc, char const *argv[]){
  7. /*
  8.     if(argc!=3){
  9.         printf("Usage ./combination [n] [r]\n");
  10.         return -1;
  11.     }
  12.     int n, k;
  13.     n = atoi(argv[1]);
  14.     k = atoi(argv[2]);
  15.    
  16.     if(k>n){
  17.         printf("Must be K < N\n");
  18.         return -1;
  19.     }
  20. */
  21.     int n = 10;
  22.     int k = 5;
  23.    
  24.     printf("Comb(%d, %d) = %d\n",n, k, comb(n,k));
  25.     // Result : 252
  26.     return 0;
  27. }
  28. int comb(int n, int k){
  29.     //Code Here
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement