Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec potega x y =
- match y with
- | 0 -> 1
- | _ -> x* (potega x (y-1))
- let rec suma x y =
- match y with
- | 0->x
- | _ -> x+y+(suma x (y-1))
- let rec czyMale (tekst:System.String) dlugosc =
- match dlugosc with
- | 0 -> System.Char.IsLower tekst.[0]
- | _ -> (System.Char.IsLower tekst.[dlugosc]) & (czyMale tekst (dlugosc-1))
- let rec r m n =
- match n with
- | 0 -> m*0
- | 1 -> m*1
- | _ -> m + (r m (n-1))
- let rec wyst str i ch =
- match i with
- | str.Length -> a
- | _ -> 0 + (wyst str (i+1) ch)
- [<EntryPoint>]
- let main _ =
- let y = "ABCDEFGHIJKL".Substring(1, 5);
- System.Console.WriteLine (potega 2 3)
- System.Console.WriteLine (suma 7 3)
- System.Console.WriteLine (czyMale "dfAAAAfg" 3)
- System.Console.WriteLine (r 7 3)
- System.Console.WriteLine y
- printf "Naciśnij klawisz..."
- ignore (System.Console.ReadKey(true))
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement