Skip to content

Update 110A - Nearly Lucky Number.cpp#32

Open
har3927 wants to merge 1 commit intofuwutu:masterfrom
har3927:patch-1
Open

Update 110A - Nearly Lucky Number.cpp#32
har3927 wants to merge 1 commit intofuwutu:masterfrom
har3927:patch-1

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