This commit is contained in:
2025-02-07 00:05:12 +05:30
parent fa0802292a
commit b92ec2a5d7

View File

@@ -1,20 +1,21 @@
import readline import readline
fn check_divisibility(e int, g int) { fn seven(b int) {
b := e / 10 mut c := b
c := e % 10 mut d := 0
d := b - 2 * c mut e := 0
mut f := g mut f := 0
if d > 99 { for c > 99 {
f = f + 1 d = c / 10
check_divisibility(d, f) e = c % 10
} else { c = d - 2 * e
if d % 7 == 0 { f += 1
println([d, f]) }
if c % 7 == 0 {
println([c, f])
} else { } else {
println('The number is not divisible by 7') println('The number is not divisible by 7')
} }
}
} }
fn main() { fn main() {
@@ -23,7 +24,5 @@ fn main() {
a := answer.int() a := answer.int()
if a > 99 { seven(a)
check_divisibility(a, 1)
}
} }