262A - Roma and Lucky Numbers

  1. 262A - Roma and Lucky Numbers

  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6. int n,k,c=0,ans=0;
  7. cin>>n>>k;
  8. while(n--)
  9. { c=0;
  10. string s;
  11. cin>>s;
  12. for(int i=0;i<s.length();i++){
  13. if(s[i]=='4' or s[i]=='7')
  14. c++;
  15.  
  16. }
  17. if(c<=k) ans++;
  18.  
  19.  
  20. } cout<<ans;
  21. return 0;
  22. }

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

Aptitude test assistant programmer 2018

1041A. Heist solution