Question: If condition with loop

When I write an conditional command I come back and press enter again and again but I need only last one for example 

>f:=x->x^2+x+1

>g:=y->y^2+2*y+6

>x:=0;y:=0

>if f(x) <g(x) then;

>x:=x+1 elif f(x) >g(x) then;

>y:=y+1 elif f(x)=g(x) then;

>x;

>y;

>f(x) end if;

I push enter and it write x:=1 then I click if command and push enter again and it writes x:=2 and continues like y:=1, x:=3, y:=2, x:=4,  y:=3 and lastly 

4

3

21

But I only need last one. Can I do this only push enter once. Of course my problem is more complicated than this f(x) , g(x) . Thanks

 

 

Please Wait...