#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
long long n;
int ans = 0;
cin >> n;
while(n) {
if(n % 10 == 7 || n % 10 == 4) ans++;
n /= 10;
}
if(ans == 4 || ans == 7) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
110A - Nearly Lucky Number
最新推荐文章于 2018-12-14 22:08:55 发布
本文介绍了一个简单的C++程序,用于判断输入的整数是否由数字4和7组成,这样的数字通常被称为幸运数。文章通过代码展示了如何逐位检查输入数字,并统计满足条件的数字个数,最后根据统计结果输出YES或NO。
549

被折叠的 条评论
为什么被折叠?



