04 2021 档案

摘要:CONTROL FLOW Primitive Types Nil 最简单的类型就是Nil,它只有一个值,意味数值不存在。 是否还记得String#index 。它返回一个nil值如果子字符串不存在于检索的字符串。它没有index,所以index位置不存在。 Bool bool类型只有两个可能的值fa 阅读全文
posted @ 2021-04-11 16:10 世界を変える御宅族 阅读(203) 评论(0) 推荐(0)
摘要:GETTING STARTED 为什么选择这门语言。没有为什么,觉得是门有意思的语言就跟了。 系统的话是centos8 通过crystal-lang 先安装,官网写的还是很清晰的在这不说了 install HELLO WORLD! puts "hello world!" 第一个程序是经典的hello 阅读全文
posted @ 2021-04-10 16:44 世界を変える御宅族 阅读(670) 评论(0) 推荐(1)
摘要:int func(int n){ int i = 0,sum = 0; while(sum < n) sum += ++i; return i; } 求时间复杂度 A. O(logn) B. O(n^1/2) C. O(n) D. O(nlogn) ++i, i = 1,2,3,4,5,···,k。 阅读全文
posted @ 2021-04-09 19:00 世界を変える御宅族 阅读(3899) 评论(0) 推荐(0)