思想:该题满足卡特兰数的通项公式:
import java.util.Scanner;
public class Catalan {
public static int tab(int n){
int res1 = 1, res2 = 1 ;
for(int i=1; i<=n; i++){
res1 *= i ;
}
for(int j=n+1; j<=2*n; j++){
res2 *= j ;
}
return (res2/res1) / (n+1) ;
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in) ;
int n = input.nextInt() ;
System.out.println(tab(n));
}
}



