program tong_chia_9; uses crt; var n,i,t:integer; begin clrscr; write(‘Nhap N: ‘); readln(n); t:=0; for i:=1 to n do if i mod 9=0 then t:=t+i; write(‘Tong cac so chia het cho 9 tu 1 den ‘,n,’ la: ‘,t); readln; end. Bình luận
program tong_chia_9;
uses crt;
var n,i,t:integer;
begin
clrscr;
write(‘Nhap N: ‘); readln(n);
t:=0;
for i:=1 to n do
if i mod 9=0 then t:=t+i;
write(‘Tong cac so chia het cho 9 tu 1 den ‘,n,’ la: ‘,t);
readln;
end.
ảnh nhoa