Quảng cáo
2 câu trả lời 192
2 năm trước
program SoHoanThien;
var
num, total, i: integer;
begin
total := 0;
write('Nhap so nguyen: ');
readln(num);
for i := 1 to num-1 do
begin
if num mod i = 0 then
total := total + i;
end;
if total = num then
writeln(num, ' la so hoan thien')
else
writeln(num, ' khong la so hoan thien');
end.
Thiên Bảo
· 2 năm trước
Cho em hỏi là num vs total là gì v ạ e chưa học
2 năm trước
program SoHoanThien;
var
num, total, i: integer;
begin
total := 0;
write('Nhap so nguyen: ');
readln(num);
for i := 1 to num-1 do
begin
if num mod i = 0 then
total := total + i;
end;
if total = num then
writeln(num, ' la so hoan thien')
else
writeln(num, ' khong la so hoan thien');
Quảng cáo
Câu hỏi hot cùng chủ đề
-
Hỏi từ APP VIETJACK1 44256
-
Hỏi từ APP VIETJACK24640
-
Hỏi từ APP VIETJACK21086
Gửi báo cáo thành công!