mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-01 23:45:50 +00:00
ce24451fde
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
22 lines
263 B
Go
22 lines
263 B
Go
package c
|
|
|
|
func Is42(a int) bool {
|
|
if a == 42 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func MulIfSmall(n int) int {
|
|
if n < 10 {
|
|
return n * 2
|
|
}
|
|
return n
|
|
}
|
|
|
|
func Transform(a, b int) int {
|
|
if Is42(a) && !Is42(b) {
|
|
return MulIfSmall(b)
|
|
}
|
|
return MulIfSmall(a)
|
|
}
|