nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
examples/rosettacode: update ab to not crash on tests
[nit.git]
/
examples
/
rosettacode
/
ab.nit
diff --git
a/examples/rosettacode/ab.nit
b/examples/rosettacode/ab.nit
index
9138c0c
..
ce18fc0
100644
(file)
--- a/
examples/rosettacode/ab.nit
+++ b/
examples/rosettacode/ab.nit
@@
-10,4
+10,8
@@
module ab
var words = gets.split(" ")
+if words.length != 2 then
+ print "Expected two numbers"
+ return
+end
print words[0].to_i + words[1].to_i