int x,y;
while(cin>>x>>y)
{
if(x>y)cout<<x<<"\n";
else if(y>x)cout<<y<<"\n";
}
This seems clear,but when I entered this:
2 4 6
and hit enter,
I get this:
4
after which I am being asked to enter something again.
I put 8,
and it prints 8.
But what is exactly happening here?
How can it accept more than 2 numbers,hold one somewhere,then later use it when the fourth number is used?
I am muddled up?