fork(2) download
  1. var
  2. i,x,y:longint;
  3. c:char;
  4.  
  5. begin
  6. i:=0; x:=0;
  7. while not EOF do
  8. begin
  9. inc(i); read(c); if c='x' then inc(x);
  10. end;
  11.  
  12. y:=i-x;
  13. if x>y then for i:=1 to i-2*y do write('x')
  14. else for i:=1 to i-2*x do write('y');
  15.  
  16. end.
Success #stdin #stdout 0s 276KB
stdin
x
stdout
x