sét tính nguyên tố của số nguyên dương n 13/07/2021 Bởi Claire sét tính nguyên tố của số nguyên dương n
program nguyên_tố; uses crt; var n,i,d:integer; begin clrscr; write(‘Nhap so nguyen duong n: ‘); readln(n); d:=0; for i:=1 to n do if n mod i=0 then d:=d+1; if d=2 then write(‘La so nguyen to’) else write(‘Khong la so nguyen to’); readln; end. Bình luận
program nguyen_to; uses crt; var n,i,d:integer; begin clrscr; write(‘Nhap so nguyen duong n: ‘); readln(n); d:=0; for i:=1 to n do if n mod i=0 then d:=d+1; if d=2 then write(‘La so nguyen to’) else write(‘Khong la so nguyen to’); readln; end. Bình luận
program nguyên_tố;
uses crt;
var n,i,d:integer;
begin
clrscr;
write(‘Nhap so nguyen duong n: ‘); readln(n);
d:=0;
for i:=1 to n do
if n mod i=0 then d:=d+1;
if d=2 then write(‘La so nguyen to’)
else write(‘Khong la so nguyen to’);
readln;
end.
program nguyen_to;
uses crt;
var n,i,d:integer;
begin
clrscr;
write(‘Nhap so nguyen duong n: ‘); readln(n);
d:=0;
for i:=1 to n do
if n mod i=0 then d:=d+1;
if d=2 then write(‘La so nguyen to’)
else write(‘Khong la so nguyen to’);
readln;
end.