Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int N;
- cin >> N;
- bool flag_2 = 0;
- bool flag_5 = 0;
- while (N != 0) {
- if (N % 10 == 2)
- flag_2 = 1;
- if (N % 10 == 5)
- flag_5 = 1;
- N /= 10;
- }
- !flag_2 * flag_5 ? cout << "YES" : cout << "NO";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement