fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6. int n , m , cnt;
  7. char str[10000];
  8. scanf("%s" , str);
  9. for (int i = 0; str[i] != '\0'; i++)
  10. {
  11. if( str[i] == '4' || str[i] == '7' )
  12. {
  13. cnt++;
  14. }
  15. }
  16. //printf("%d\n" , cnt);
  17. if( cnt == 4 || cnt == 7)
  18. {
  19. printf("YES\n");
  20. }
  21. else
  22. {
  23. printf("NO\n");
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 5464KB
stdin
Standard input is empty
stdout
NO