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
| program aaaaaaa;
var t : text ;
s,b: string ;
a,cmpt: integer;
pasfini: boolean;
begin
assign(t,'nom');
reset(t);
readln(t,s);
if pos('euros',s)<>0 then
begin
a:= pos('euros',s);
b:= copy(s,1,a-2);
cmpt:= a-2;
pasfini:= true ;
while pasfini do
begin
if (b[cmpt]<>'1') and (b[cmpt]<>'2') and (b[cmpt]<>'3') then(je ne me rappelle plus comment dire que b[cmpt] n''est pas un nombre)
begin
delete(b,1,cmpt);
pasfini:= false;
end
else
begin
cmpt:= cmpt-1;
pasfini:= true;
end;
end;
end; |
Partager