15 lines
219 B
Plaintext
15 lines
219 B
Plaintext
|
|
#include "math_lib.rc"
|
||
|
|
#include "string_lib.rc"
|
||
|
|
|
||
|
|
int is_even(int n) {
|
||
|
|
int half = divide(n, 2);
|
||
|
|
return multiply(half, 2) == n;
|
||
|
|
}
|
||
|
|
|
||
|
|
int is_odd(int n) {
|
||
|
|
if (is_even(n)) {
|
||
|
|
return 0;
|
||
|
|
}
|
||
|
|
return 1;
|
||
|
|
}
|