-
Notifications
You must be signed in to change notification settings - Fork 51
/
a.cpp
61 lines (56 loc) · 1.23 KB
/
a.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define pii <pair<int,int>
#define vi vector<int>
#define vp vector<pair<int, int>>
#define vpp vector<pair<pair<int, int>, int>>
#define si set<int>
#define ll long long
#define ld long double
#define pqf priority_queue<int, vector<int>>
#define pqb priority_queue<int, vector<int>, greater<int>>
#define ps(x, y) fixed << setprecision(y) << x
#define MOD 1e9
#define PI 3.1415926535
void swap(int *a, int *b)
{
int temp = *a;
*a = *b;
*b = temp;
}
int arraySum(int a[], int n)
{
int initial_sum = 0;
return accumulate(a, a + n, initial_sum);
}
void solve()
{
string s;
int k=0;
cin>>s;
for (int i = 0; i < s.length(); i++)
{
if((s[i]=='4')||s[i]=='7'){
k++;
}
}
cout<<(k==4||k==7?"YES":"NO");
}
int main()
{
IOS
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#else
#endif
// int t;
// cin >> t;
// while (t--)
solve();
return 0;
}