#Mencari_Permutasi
def faktorial(n) :
if n==0 :
return 1
else :
return n*faktorial(n-1)
def permutasi(n,r):
return ((faktorial(n))/(faktorial(n-r)))
def CariPermutasi(n,r):
nCr = int(permutasi(n,r))
return nCr
def Main():
print("- Mencari Permutasi -")
n = int(input("n = "))
r = int(input("r = "))
x = CariPermutasi(n,r)
print("C(",n,"," ,r,") = ", x)
Main()
Di atas : coding
Gambar : ketika dijalankan
Tidak ada komentar:
Posting Komentar