Cod sursa(job #111466)
Utilizator | Data | 29 noiembrie 2007 21:49:54 | |
---|---|---|---|
Problema | Ordine | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
Var f,g:Text;
x:Char;
p:String;
ok:Boolean;
i:Longint;
Begin
Assign(f,'ordine.in'); ReSet(f);
Assign(g,'ordine.out'); ReWrite(g);
Read(f,x);
p:=x;
While Not EOF(f) Do Begin
While Not EOLN(f) Do Begin
Read(f,x);
i:=1;
ok:=False;
Repeat
if (x<p[i])and(x<>p[i-1])and(x<>p[i+1]) Then Begin
Insert(x,p,i);
ok:=True;
End;
Inc(i);
Until ok;
End;
ReadLn(f);
End;
WriteLn(g,p);
Close(f);
Close(g);
End.