// For more information see https://aka.ms/fsharp-console-apps printfn"Hello from F#" open System // Gets access to functionality in System namespace.
// Defines a list of names let names = [ "Peter"; "Julia"; "Xi" ]
// Defines a function that takes a name and produces a greeting. let getGreeting name =$"Hello, {name}"
// Prints a greeting for each name! names |> List.map getGreeting |> List.iter (fun greeting ->printfn$"{greeting}! Enjoy your F#")
for cnt =1to12do printf$"nice to see you ,{cnt} \n"
letmutable cnt =0;//F#中let默认生成的值是自动绑定的,也就是不可变值,假如想要让let的值可变,那么就用mutable属性来修饰。 for name in names do cnt <- cnt +1 printfn$"hello ,No.{cnt} Are you {name}?"