1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
program aaaaaaa;
var t : text ;
s,b,c,w: string ;
a,cmpt,i: integer;
pasfini: boolean;
begin
assign(t,'nom');
reset(t);
while not eof(t) do
begin
c:='';
readln(t,s);
a := Pos('euros',s);
if a = 0 then
begin
a := pos('E',s);
if a = 0 then
begin
a := Pos('K',s);
c:='000';
if a=0 then
w:= s ;
end;
end;
if(a<>0)and(a<>1)then
begin
b:= copy(s,1,a-2);
cmpt:= a-2;
pasfini:= true ;
while pasfini and (cmpt<>0) do
begin
if (b[cmpt]<>'.') and (b[cmpt]<>'0') and (b[cmpt]<>'1') and (b[cmpt]<>'2') and (b[cmpt]<>'3') and (b[cmpt]<>'4') and (b[cmpt]<>'5') and (b[cmpt]<>'6') and (b[cmpt]<>'7') and (b[cmpt]<>'8') and (b[cmpt]<>'9') then
begin
delete(b,1,cmpt);
pasfini:= false;
end
else
begin
cmpt:= cmpt-1;
pasfini:= true;
end;
end;
if a=1 then
begin
i := length(w) ;
while pasfini and (i<>0) do
begin
if (w[i]<>'.') and(w[i] in ['0'..'9'])then
begin
pasfini:= false;
end
else
begin
i:= i-1;
pasfini:= true;
end;
end;
writeln(w);
end;
end;
writeln(b+c);
end;
close(t);
end. |
Partager