fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int x = 2, y=1;
  7. while (y<8){
  8. cout << x <<" ";
  9. if(y%2==1){
  10. x+=3;
  11. y++;
  12. }
  13. else{
  14. x+=2;
  15. y++;
  16. }
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 4252KB
stdin
Standard input is empty
stdout
2  5  7  10  12  15  17