fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int X,y;
  7. cin >> X>>y;
  8. int c = 0;
  9. for (int i = X;i<=y;i++)
  10. {
  11. int m = i % 10;
  12. if (m == 4|| m==7) {
  13. cout << m<<" ";
  14. c++;
  15. }
  16.  
  17. }
  18. if (c == 0) { cout << -1; }
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
-1