Nhờ đề này ra số thực thay cho số nguyên mà đã học được thuật toán mới,thank you
(nhìn phức tạp là do đề ra số thực chứ ko phải do nó khó đâu)
Program solve;
uses crt;
var n,i,d,code:integer;
st1:string;
e:array[1..150] of real;
Function check(st:string):boolean;
var j,num,code:integer;
pointcheck:boolean;
begin
for j:=length(st) downto 1 do
begin
if (st[j]='0') and (not pointcheck) then continue;
if (st[j]='.') then
begin
pointcheck:=true;
continue;
end;
Val(st[j],num,code);
if num mod 2=0 then exit(true);
exit(false);
end;
end;
Begin
clrscr;
write('Nhap n:'); readln(n);
for i:=1 to n do
begin
write('Nhap e[',i,']:'); readln(st1);
Val(st1,e[i],code);
if check(st1) then
begin
inc(d);
writeln(st1);
end;
end;
writeln('So so chan trong day:',d);
readln;
End.