006
This commit is contained in:
20
between.v
Normal file
20
between.v
Normal file
@@ -0,0 +1,20 @@
|
||||
import readline
|
||||
|
||||
fn between(a int, b int) {
|
||||
mut result := []int{}
|
||||
for i := a; i <= b; i++ {
|
||||
result << i
|
||||
}
|
||||
println(result)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
mut r := readline.Readline{}
|
||||
answer := r.read_line('What is the starting number: ')!
|
||||
answer2 := r.read_line('What is the ending number: ')!
|
||||
|
||||
a := answer.int()
|
||||
b := answer2.int()
|
||||
|
||||
between(a, b)
|
||||
}
|
Reference in New Issue
Block a user