Advertisement
RuslanMag

26

Jan 26th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int N[10] = {1, 127, 1237, 12347, 12345, 123456, 1234567, 1234567, 123456, 1234};
  8.  
  9.     for (int i = 0; i < 10; i++)
  10.     {
  11.         bool ok = true;
  12.        
  13.         if ((N[i] % 10 == 4 || N[i] % 10 == 7) || (N[i] % 100 / 10 == 4 || N[i] % 100 / 10 == 7) || (N[i] % 1000 / 100 == 4 || N[i] % 1000 / 100 == 7) || (N[i] % 10000 / 1000 == 4 || N[i] % 10000 / 1000 == 7) || (N[i] % 100000 / 10000 == 4 || N[i] % 100000 / 10000 == 7) || (N[i] % 1000000 / 100000 == 4 || N[i] % 1000000 / 100000 == 7))
  14.         {
  15.             ok = false;
  16.         }
  17.  
  18.         if (ok)
  19.         {
  20.             cout << N[i] << " ";
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement