Viết chương trình đọc dữ liệu từ tệp Lop.TXT Tính tổng theo dòng và ghi kết quả ra tệp KQ.TXT
0 bình luận về “Viết chương trình đọc dữ liệu từ tệp Lop.TXT Tính tổng theo dòng và ghi kết quả ra tệp KQ.TXT”
var a,b:text; s:integer;
begin assign(a,’number.txt’); assign(b,’KQ.txt’); reset(a); rewrite(b); while not eof(a) do begin read(a,s); if s mod 3 =0 then writeln(b,’s=’,s,s:3); end; close(a); close(b); readl
var a,b:text;
s:integer;
begin
assign(a,’number.txt’);
assign(b,’KQ.txt’);
reset(a);
rewrite(b);
while not eof(a) do
begin
read(a,s);
if s mod 3 =0 then
writeln(b,’s=’,s,s:3);
end;
close(a);
close(b);
readl
chúc bạn hok tốt