Skip to content

Commit

Permalink
Feat:Add solution of #118
Browse files Browse the repository at this point in the history
  • Loading branch information
sa11k committed Aug 2, 2022
1 parent c28be7d commit 3a5b151
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/BaekJoon/sa11k/11050/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import java.io.*;
import java.util.*;

class Main {

public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int K = Integer.parseInt(st.nextToken());

System.out.println(fac(N)/(fac(N-K)*fac(K)));

br.close();
}

public static int fac(int n){
int f = 1;
for(int i = 1; i<=n; i++){
f*=i;
}
return f;
}
}

0 comments on commit 3a5b151

Please sign in to comment.