Viết chương trình ghi vào tệp chuso.txt trong ỏ đĩa D các số chia hết cho 2,3 trongphạm vi từ 100 đến 1000
0 bình luận về “Viết chương trình ghi vào tệp chuso.txt trong ỏ đĩa D các số chia hết cho 2,3 trongphạm vi từ 100 đến 1000”
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); readln end.
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);
readln
end.