[code]#light
let mathsPuzzle() =
print_string "Enter day of the month on which you were born: "
let input = read_int ()
let x = input * 4 // Multiply it by 4
let x = x + 13 // Add 13
let x = x * 25 // Multiply the result by 25
let x = x - 200 // Subtract 200
print_string "Enter number of the month you were born: "
let input = read_int ()
let x = x + input
let x = x * 2 // Multiply by 2
let x = x - 40 // Subtract 40
let x = x * 50 // Multiply the result by 50
print_string "Enter last two digits of the year of your birth: "
let input = read_int ()
let x = x + input
let x = x - 10500 // Finally, subtract 10,500
printf "Date of birth (ddmmyy): %i" x
mathsPuzzle()[/code]
上述代码保存为samples.fs.
在F# Version 1.9.2.9 ;.Net Framework Version v2.0.50727环境下用fsc.exe编译器。
![]()
订阅我
-
关注的朋友
友情链接
近期评论
- pitt 在 想卖掉Bambook 上的评论
- 西小西 在 想卖掉Bambook 上的评论
- shyla 在 下载的CHM文件打开空白 上的评论
- 外闻网 在 给Firefox4开启2D加速 上的评论
- 西安婚纱摄影 在 四六级剩5分钟还两篇阅读没做怎么办? 上的评论

更新更新!
[回复]