Josif_tepe

Untitled

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