[Haskell on HackerEarth] Life, the Universe, and Everything
来源:互联网 发布:电子相册制作软件 手机 编辑:程序博客网 时间:2024/05/22 06:19
原题链接
输入:多行数字
输出:42前(不包含)的所有内容
main = interact func where func = unlines . takeWhile (/="42") . words
Tips:
- Haskell里面words和lines函数是把多个单词、行拆成字符串列表,unlines和unwords是把字符串列表合并成一个由换行符/空格分隔的字符。这一点优点反直觉,总之记下来就好。
0 0
- [Haskell on HackerEarth] Life, the Universe, and Everything
- Life, the Universe, and Everything
- SPOJ 1. Life, the Universe, and Everything
- spoj 1 Life, the Universe, and Everything
- 【CodeChef】 Life, the Universe, and Everything
- the answer to life, the universe and everything
- Life, the Universe, and Everything 1 Sphere Online Judge
- SPOJ1 - Life, the Universe, and Everything (水题)
- [Haskell on HackerEarth] Roy and Profile Picture
- [Haskell on HackerEarth] Monk and Digital World
- [Haskell on HackerEarth] Monk and Welcome Problem
- [Haskell on HackerEarth] Factorial!
- [Haskell on HackerEarth] Toggle String
- [Haskell on HackerEarth] Palindromic String
- [Haskell on HackerEarth] Magical Word
- [Haskell on HackerEarth] Find Product
- [Haskell on HackerEarth] Count Divisors
- [Haskell on HackerEarth] Min-Max
- LeetCode 7.Reverse Integer
- js编码
- 开通博客记录
- 安卓环境搭建
- 第56篇一对多实现之私有白板向老师端传图片数据(三)仿制传图片dataURL及array_replace及array_replace_recursive
- [Haskell on HackerEarth] Life, the Universe, and Everything
- WebService框架cxf导入包后编译找不到主类
- c语言扫雷游戏
- 斐波那契数列的优化问题 青蛙跳台阶问题
- PAT甲级1004. Counting Leaves (30)
- springMVC+spring3.1.1+hibernate4.1.0集成及常见问题总结
- 多目标跟踪 综述(三)
- 闰年的判断
- 理解mmap