#10514: 求解:TLE...


s15113135 (隊友不是拉基就是拉基)

學校 : 樹德科技大學
編號 : 54009
來源 : [118.163.233.130]
最後登入時間 :
2018-09-12 20:06:28
c061. 00530 - Binomial Showdown -- UVa530 | From: [114.39.56.100] | 發表日期 : 2015-12-02 23:02

import java.util.Scanner;

public class student {

public static void main(String[] args) {

 

Scanner scanner = new Scanner(System.in);

while (scanner.hasNext()){

double n = scanner.nextInt();

double m = scanner.nextInt();

if (n==0 && m==0) {

System.exit(0);

}

else {

double m1=1 , o=1;

for (double a = n ; a > n-m; a--) {

o = o*a;

}

for (double b = 1 ; b <= m ; b++ ) {

m1 = m1*b;

}

double n1 = o/m1;

int change = (int)n1; 

System.out.println(change);

}

}

}

}

小弟不才... 救救我~

 
ZeroJudge Forum