fork(6) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b;
  7. int number = 0;
  8. cin >> a >> b;
  9. for (int i = a; i <= b; i++) {
  10. if (i % 7 == 0) {
  11. number++;
  12. cout << i << ' ';
  13. }
  14. }
  15.  
  16. cout << "\n";
  17. cout << "number: " << number << "\n";
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 4572KB
stdin
10
50
stdout
14 21 28 35 42 49 
number: 6