1、用于迭代器之后
Ruby的迭代器与其他语言的迭代器很不相同,它的迭代器一般都是函数,如:
def three_times
yield
yield
yield
end
使用实例: three_times { puts “hello”}
Ruby内置了一些迭代器如find,eac...
分类:
其他好文 时间:
2015-04-11 19:33:04
阅读次数:
127
gem是一种文件组织的包,一般的ruby的很多插件都有由这种各种的包提供。我们来看看gem的用法ruby -v #查看ruby 版本 ruby -e ''require"watir"; puts Watir::IE::VERSION'' #查看watir版本rvm list known #列出已知的...
分类:
其他好文 时间:
2015-04-11 11:46:42
阅读次数:
123
链接:#include
int main()
{
puts("转载请注明出处[vmurder]谢谢");
puts("网址:blog.csdn.net/vmurder/article/details/44891009");
}题意、题解、数据、出题人标程http://wjmzbmr.com/archives/zjoi-2015-day-1%e9%a2%98%e8%...
分类:
其他好文 时间:
2015-04-06 09:00:05
阅读次数:
146
题目1 : Magic Box时间限制:10000ms单点时限:1000ms内存限制:256MB描述The circus clown Sunny has a magic box. When the circus is performing, Sunny puts some balls into th...
分类:
其他好文 时间:
2015-04-04 18:11:10
阅读次数:
138
做一个ASIC项目,基本结构是MCU+ROM+RAM。目前想把单片机程序下载到ROM中,然后在ModelSim中仿真程序,得到运行结果。好二哥给出的Tcl下载文件如下,细细研读中...puts "====================================================...
分类:
其他好文 时间:
2015-04-02 06:37:07
阅读次数:
134
1,C 输入输出字符串另一种方法gets/puts 函数warning: the `gets' function is dangerous and should not be used2,C 程序中使用system执行OS 命令行,并在system中使用变量(实现linux passwordLess...
分类:
移动开发 时间:
2015-03-30 20:47:27
阅读次数:
141
class Language def initialize(name, creator) @name = name @creator = creator end def description puts "I'm #{@name} and...
分类:
其他好文 时间:
2015-03-30 20:27:47
阅读次数:
105
Proc 和 lambda 的共同点:语法类似Proc.new{|n| n**2}lambda{|n| n**2}都可以用.call方法调用hello_proc = Proc.new{ puts "Hello!" }hello_proc.call #Hello!hello_lambda = lamb...
分类:
其他好文 时间:
2015-03-30 18:13:50
阅读次数:
104
#include void main() { puts("hello world"); int x=4; //the %p format will print out the location in hex(base lb) format printf("x lives at %p\n",&x); ...
分类:
其他好文 时间:
2015-03-29 13:37:39
阅读次数:
114
😊字符串处理函数#include // 字符串数组头文件 // puts输出函数 char str[20] = "zyp"; printf("who loves %s\n", str);// 不会自动换行 puts(str); puts("gj"); // 不能进行格式化输出 // ge...
分类:
编程语言 时间:
2015-03-21 14:03:13
阅读次数:
218