0

Pascal üçgeni

public class binomUcgeni{ public static void main(String args[]){ int maxSatir=6; for(int n =0;n<=maxSatir;n++){ for(int k=0;k<=n;k++){ System.out.print(fact(n)/(fact(k)*fact(n-k))+" "); } System.out.println(); } } public static double fact(double x){ if ( x == 0 ) return 1; if ( x == 1 ) return 1; else return x* fact ( x-1); } }

16th Dec 2017, 12:56 PM
Metehan
1 Resposta
+ 1
Odk
26th Jun 2019, 7:05 PM
Mahdi