int main()
{
int x=5,y=7;
//first 7 numbers
for (int i=0; i<3; i++)
{
cout<<x<<" ";
if (i!=2)//don't output y the 3rd time
cout<<y<<" ";
x+=5;
if (i==2)//output new x and then y instead
cout<<x<<" "<<y;
y+=7;
} //last 3 numbers
for (int i=0; i<2; i++)
{
x+=5;//add another 5 to x
cout<<" "<<x<<" ";//output x
if (i==0)
cout<<y;//output last y
}//the second time 5 is added to x and 30 is outputted
return 0;//terminate program
}
I was trying to come up with a relatively short solution that doesn't contain any numbers whatsoever (i.e. it doesn't contain any of the characters 0123456789), but I gave up because it was getting to be too long to fit completely on one line of code (sans the #include ) and within the boundaries of the post.
So instead, I'll just offer this:
1 2
#include <iostream>
int main(){for(int i=1;i<6;++i)std::cout<<(i>3?7*i-7:5*i)<<' '<<(i<3?7*i:5*i+5)<<' ';}
The OP never asked for the program to be obfuscated, modular/extensible, dynamic, etc. so I have no idea why you are all suggesting such complex solutions.