Из Питона в С++!!


def f(n, k):
if n == 1:
return k
return (k-1)*(f(n-1, k) + g(n-1, k))

def g(n, k):
if n == 1:
return 1
return f(n-1, k)

n, k = map(int, input().split())
print(f(n, k))
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.