Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool divisors_odd(int x, int y) {
- if (x < 100) return ((y % (x % 10)) == 0);
- else {
- return (y % (x % 10) == 0) and divisors_odd(x / 100, y);
- }
- }
- int main() {
- int x, y;
- while (cin >> x >> y) {
- if (divisors_odd(x, y)) cout << "YES";
- else cout << "NO";
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement