Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.21 KB | None | 0 0
  1. open System
  2. [<EntryPoint>]
  3. let main argv =
  4.     let rec sum list =
  5.         match list with
  6.         | head::tail -> if head>0 then 1+ (sum tail) else (sum tail)
  7.         | [] -> 0
  8.     let sp = [1..5]
  9.     printfn "%A\n" (sum sp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement