Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let wypisz (x, y) =
- match (x, y) with
- | x, y -> printf "Suma wynosi %f. Srednia geometryczna wynosi %f" x y
- let rec drukuj_pom ile znak =
- if ile > 0 then
- printf "%c" znak
- drukuj_pom (ile - 1) znak
- else
- if znak = ' ' then
- printf ""
- else
- printfn ""
- let rec choinka metoda wiersze wiersz =
- if metoda = 1 then
- if wiersze > 0 then
- drukuj_pom wiersz '*'
- choinka 1 (wiersze - 1) (wiersz + 1)
- else printfn ""
- else
- if metoda = 2 then
- if wiersze > 0 then
- drukuj_pom (wiersze - wiersz) ' '
- drukuj_pom (wiersz * 2 - 1) '*'
- choinka 2 (wiersze - 1) (wiersz + 1)
- else printfn ""
- else
- if wiersze > 0 then
- drukuj_pom wiersz '*'
- choinka 1 (wiersze - 1) (wiersz + 1)
- else printfn ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement