aboutsummaryrefslogtreecommitdiff
path: root/NearlyLuckyNumber/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NearlyLuckyNumber/main.cpp')
-rw-r--r--NearlyLuckyNumber/main.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/NearlyLuckyNumber/main.cpp b/NearlyLuckyNumber/main.cpp
deleted file mode 100644
index d807b1a..0000000
--- a/NearlyLuckyNumber/main.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include<bits/stdc++.h>
-
-using namespace std;
-
-bool isLucky(string s) {
- for(int i = 0; i < s.size(); i++) {
- if(s[i] != '4' && s[i] != '7') {
- return false;
- }
- }
- return true;
-}
-
-int main () {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- long long n;
- cin >> n;
- string s = to_string(n);
- int cnt = 0;
- for(auto ch : s) {
- if(ch == '4' || ch == '7') {
- cnt ++;
- }
- }
- if(isLucky(to_string(cnt))) {
- cout << "YES";
- } else {
- cout << "NO";
- }
-}