fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int oddNo, nextOddNo;
  6. cin >> oddNo >> nextOddNo;
  7. int i = oddNo;
  8. while(nextOddNo) {
  9. if (i % 2 == 0 && i > oddNo) {
  10. --nextOddNo;
  11. cout << i << " ";
  12. }
  13. ++i;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5276KB
stdin
-6 3 
stdout
-4 -2 0