Advertisement
dllbridge

Untitled

Nov 23rd, 2022
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. string a;
  5. int w;
  6.  
  7. int main()
  8. {
  9.     cin >> a;
  10.    
  11.     if(a.size() == 1){ cout << "NO"; return 0;}
  12.    
  13.     for(int i = 0; i < a.size(); i++)  if(a[i] == '7' || a[i] == '4') w+=1;
  14.  
  15.     if(w == 0)           { cout <<  "NO"; return 0;}
  16.     if(w == 4 || w == 7) { cout << "YES"; return 0;}
  17.  
  18.     cout << "NO";
  19.    
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement