Guest User

Untitled

a guest
Jan 12th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. int n;
  8. cin >> n;
  9. int ost = 0, p = 1, check = 0;
  10. bool b = 0;
  11. while (p * 10 <= n) {
  12. p *= 10;
  13. }
  14. do {
  15. ost = n / p;
  16. if (ost == 3 && check == 3) {
  17. b = 1;
  18. }
  19. check = 0;
  20. if (ost == 3) {
  21. check = ost;
  22. }
  23. n %= p;
  24. p /= 10;
  25. } while (p);
  26. if (b) {
  27. cout << "YES";
  28. } else {
  29. cout << "NO";
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment