Können Sie sich vorstellen, was dieser Code in Swift bewirkt?

func secretFunction(of num: Int) -> Int {
if num == 1 {
return 1
} else {
return num * secretFunction(of:num - 1)
}
}
view raw puzzle2_1.dart hosted with ❤ by GitHub

Und welches Ergebnis würden Sie für den folgenden Code sehen:

let x = 4
let result = secretFunction(of: x)
view raw puzzle2_2.swift hosted with ❤ by GitHub

?

Mehr davon

Get in touch

In Kontakt kommen

Frankfurt am Main, Germany (Sales)

60354

Eckenheimer Schulstraße, 20

+38 (098) 630-49-85

info@a5.ua

Kharkiv, Ukraina

61023

Trinklera Strasse, 9

+38 (050) 908-31-07

info@a5.ua

Burgas, Bulgaria (Development)

8008

бул. „Транспортна“ 15, Northern Industrial Zone

+359 877 350129

info@a5.ua