Josif_tepe

Untitled

Feb 26th, 2026
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n;
  6.     cin >> n;
  7.    
  8.     int result = 0;
  9.     for(int i = 0; i < n; i++) {
  10.         int number;
  11.         cin >> number;
  12.        
  13.        
  14.         int pretpostavka = 1;
  15.         for(int j = number; j > 0; j /= 10) {
  16.             int cifra = j % 10;
  17.            
  18.             if(cifra != 1 and cifra != 4 and cifra != 7) {
  19.                 pretpostavka = 0;
  20.             }
  21.         }
  22.        
  23.         if(pretpostavka == 1) {
  24.             result++;
  25.         }
  26.     }
  27.    
  28.     cout << result << endl;
  29.     return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment