题目:http://codeforces.com/contest/262/problem/A
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main() { int n,k; cin >> n >> k; int num; int ans=0; char digit[10]; for(int i=0;i<n;i++) { int counter=0; cin >> num; int flag=1; sprintf(digit,"%d",num); int len = strlen(digit); for(int j=0;j<len;j++) { if((digit[j]-'0')==4||(digit[j]-'0')==7) { counter++; } if(counter>k) { flag=0; break; } } if(flag==1) ans++; } cout << ans <<endl; return 0; }