fuwutu / CodeForces

CodeForces
383 stars 215 forks source link

Update 110A - Nearly Lucky Number.cpp #32

Open har3927 opened 2 years ago

har3927 commented 2 years ago

include <bits/stdc++.h>

using namespace std;

int main() { string s; cin>>s; int n=s.length(); int count=0; for(int i=0;i<n;i++){ if(s[i]=='4'||s[i]=='7'){ count++; } } if(count==4||count==7){ cout<<"YES"; } else{ cout<<"NO"; }

return 0;

}