This commit is contained in:
2025-02-06 23:43:35 +05:30
parent 2f4e62c3af
commit fa0802292a

29
divisibility_by_7.v Normal file
View File

@@ -0,0 +1,29 @@
import readline
fn check_divisibility(e int, g int) {
b := e / 10
c := e % 10
d := b - 2 * c
mut f := g
if d > 99 {
f = f + 1
check_divisibility(d, f)
} else {
if d % 7 == 0 {
println([d, f])
} else {
println('The number is not divisible by 7')
}
}
}
fn main() {
mut r := readline.Readline{}
answer := r.read_line('What is your number: ')!
a := answer.int()
if a > 99 {
check_divisibility(a, 1)
}
}