2 Star 0 Fork 0

chen7897499/exercise

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ex3.rb 648 Bytes
一键复制 编辑 原始数据 按行查看 历史
wangliyao 提交于 2017-10-29 23:56 . 练习第三天
# check how many chickens are there.
puts 'I will now count my chichens:'
# hens have 30.
puts 'Hens', 25 + 30 / 6
# roosters have 97.
puts 'Roosters', 100 - 25 * 3 % 4
# the number of eggs.
puts 'Now I will count the eggs:'
# number : 7
puts 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
# is it true
puts 'Is it true that 3 + 2 < 5 - 7?'
# false
puts 3 + 2 < 5 - 7
# 5
puts 'what is 3 + 2?', 3 + 2
# -2
puts 'what is 5 - 7?', 5 - 7
# it's false
puts "Oh, that's why it's false."
# it's false
puts 'How about some more.'
# true
puts 'Is it greater?', 5 > -2
# true
puts 'Is it greater or equal?', 5 >= -2
# false
puts 'Is it less or equal?', 5 <= -2
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bomb/exercise.git
git@gitee.com:bomb/exercise.git
bomb
exercise
exercise
master

搜索帮助