- 博客(5)
- 收藏
- 关注
原创 欧拉项目05 ruby版
#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.#What is the smallest positive number that is evenly divisible by all of the numbers from 1
2014-07-20 15:32:16
498
原创 用ruby打印杨辉三角
def p_tri(n) count =1 arr = [0,1] begin pope = arr.shift tope = arr[0] if (pope != 0) print pope.to_s+' ' else print "\n" arr << 0 count += 1 end
2014-07-10 01:52:25
658
原创 c++编程实用教程摘录(简明、查漏补缺)
c++ 概述 void的用法:1.限定无参数,2.void*定义通用指针指向任意类型的数据 c++内存空间有四个:代码区,全局变量与静态变量区,局部变量区,动态存储区----时刻不能忘 malloc在分配的时候不进行初始化,因此需要显式调用构造函数,new分配的同时进行初始化,即使后面没有跟括号和初始化参数。 内联函数的好处:利于结构化编程的同时避免函数调用
2014-03-22 22:25:56
801
原创 haskell中的typeclass和类型系统
近来学习haskell,看了网上大部分教程,都是只有基础没有进阶,无奈只能自己翻paper慢慢看,关于typeclass这块,正在看typeclassopedia (by Brent Yorgey),于是做了简单的总结,如下1.基本typeclass 之间的关系其中实线箭头表示派生,实线双箭头表示等价,虚线箭头表示其他的含义(作者没说具体是什么),灰色框表示标准库未定义的typecla
2014-01-01 15:11:59
3737
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人