可以说我有一个字符串“COLIN”。F中的Char值#
此字符串的数值将是值得:
3 + 15 + 12 + 9 + 14 = 53。
所以
A = 1,B = 2,C = 3等等。
我不知道该如何在F#中启动。
let mutable nametotal = 0
let rec tcalculate name =
name.ToString().ToCharArray()
|> Seq.length
这是我到目前为止。 seq.length
就在那里进行测试,看看toCharArray
是否真的有效。
一个问题,“let dictionary = dict table”是什么意思..特别是“dict”在这种情况下做了什么? – masfenix 2009-02-09 03:12:58