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