Viết chương trình đọc tệp NGUON. TXT gồm 2 số nguyên M,N (M { "@context": "https://schema.org", "@type": "QAPage", "mainEntity": { "@type": "Question", "name": " Viết chương trình đọc tệp NGUON. TXT gồm 2 số nguyên M,N (M
0 bình luận về “Viết chương trình đọc tệp NGUON. TXT gồm 2 số nguyên M,N (M<N). Ghi tên tệp DICH. TXT tất cả các giá trị trong đoạn (M, N) thỏa mãn là bội của 3 và 7”
uses crt; var a : array[1..100] of integer; n,i,m : integer; begin clrscr ; assign(input,’nguon.txt’); assign(output,’dich.txt’); reset(input); rewrite(output); readln(input,m,n); for i:=m to n do if ( i mod 3 = 0 ) and ( i mod 7 = 0) then write(output,i); close(input); close(output); readln end.
uses crt;
var a : array[1..100] of integer;
n,i,m : integer;
begin clrscr ;
assign(input,’nguon.txt’);
assign(output,’dich.txt’);
reset(input); rewrite(output);
readln(input,m,n);
for i:=m to n do if ( i mod 3 = 0 ) and ( i mod 7 = 0) then write(output,i);
close(input);
close(output);
readln
end.