Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int result = 0;
- for(int i = 0; i < n; i++) {
- int number;
- cin >> number;
- int pretpostavka = 1;
- for(int j = number; j > 0; j /= 10) {
- int cifra = j % 10;
- if(cifra != 1 and cifra != 4 and cifra != 7) {
- pretpostavka = 0;
- }
- }
- if(pretpostavka == 1) {
- result++;
- }
- }
- cout << result << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment