Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <algorithm>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int ost = 0, p = 1, check = 0;
- bool b = 0;
- while (p * 10 <= n) {
- p *= 10;
- }
- do {
- ost = n / p;
- if (ost == 3 && check == 3) {
- b = 1;
- }
- check = 0;
- if (ost == 3) {
- check = ost;
- }
- n %= p;
- p /= 10;
- } while (p);
- if (b) {
- cout << "YES";
- } else {
- cout << "NO";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment