Skip to content

Conversation

@har3927
Copy link

@har3927 har3927 commented Mar 30, 2022

#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;

}

#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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant