Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <algorithm>
- #include <string>
- #include <map>
- #include <cmath>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- int n;
- cin >> n;
- int d1 = n%10;
- int d2 = ( n - n%10 ) / 10;
- if (d1%d2 == 0 || d2%d1 == 0) cout << "YES";
- else cout << "NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment