标签:print java代码 turn for port code ret sys else
1 import java.util.Scanner; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 Scanner scanner = new Scanner(System.in); 7 int n = scanner.nextInt(); 8 for (int i = 1; i <= n; i++) { 9 int a = scanner.nextInt(); 10 int b = scanner.nextInt(); 11 System.out.println(dg(a, b)); 12 } 13 } 14 15 public static int dg(int a, int b) { 16 if (b == 0) 17 return 1; 18 else if (a == 1) 19 return 1; 20 else if (a == b) 21 return 1; 22 else 23 return dg(a-1,b-1)+dg(a-1,b); 24 } 25 }
标签:print java代码 turn for port code ret sys else
原文地址:https://www.cnblogs.com/Angfe/p/10810530.html