HOC24
Lớp học
Môn học
Chủ đề / Chương
Bài học
khỏi ý 1 nha
program bai1;
var n,s,i:longint;
begin
write('N= ');readln(n);
write('Uoc cua ',n,' la: ');
for i:=1 to n do
if (n mod i=0) then write(i,' ');
s:=0;
if (n mod i=0) then
if (i mod 2=0) then s:=s+i;
writeln('Tong cac uoc chan la: ',s);
readln
end.
thiếu xuống dòng
thêm ở chỗ if........ then
dem:=0;
write(a*100+b*10+c);
if dem=5 then writeln;
var a,b,c:longint;
for a:=1 to 9 do
for b:=0 to 9 do
for c:=0 to 9 do
if (((a*100+b*10+c) mod 2=0) and ((a*100+b*10+c) mod 3=0) and ((a*100+b*10+c) mod 5=0)) then write(a*100+b*10+c);
neu cach giai giup minh
if ((a*100+b*10+c)=(a*a*a+b*b*b+c*c*c) then writeln(a*100+b*10+c);
var a:array[1..100] of longint;
s,i,n:longint;
repeat
until n>0;
write('A[',i,']= ');readln(a[i]);
if a[1] =0 then exit;
end;
if a[i]>0 then s:=s+1/a[i];
writeln('Tong la ',s);
thêm vào nhập mảng
if a[1]=0 then exit;
var n:longint;
while n>5 do
writeln('Moi ban nhap lai gia tri cua n ');
write('N= ');
readln(n);