003.1
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
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)
|
||||
fn seven(b int) {
|
||||
mut c := b
|
||||
mut d := 0
|
||||
mut e := 0
|
||||
mut f := 0
|
||||
for c > 99 {
|
||||
d = c / 10
|
||||
e = c % 10
|
||||
c = d - 2 * e
|
||||
f += 1
|
||||
}
|
||||
if c % 7 == 0 {
|
||||
println([c, f])
|
||||
} else {
|
||||
if d % 7 == 0 {
|
||||
println([d, f])
|
||||
} else {
|
||||
println('The number is not divisible by 7')
|
||||
}
|
||||
println('The number is not divisible by 7')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +24,5 @@ fn main() {
|
||||
|
||||
a := answer.int()
|
||||
|
||||
if a > 99 {
|
||||
check_divisibility(a, 1)
|
||||
}
|
||||
seven(a)
|
||||
}
|
||||
|
Reference in New Issue
Block a user