var m:int64;
function goc(n:int64):int64;
var i:longint;g:int64;
begin
g:=1;
for i:=2 to trunc(sqrt(n)) do
begin
if n mod i = 0 then g:=g*i;
while n mod i=0 do
begin
//write(i,' ');
n:=n div i;
end;
end;
if n>1 then g:=g*n;
exit(g);
end;
procedure giai;
begin
while m>1 do
begin
if goc(m)=m then
begin
write(m);
exit;
end;
dec(m);
end;
end;
begin
assign(input, 'goc.inp');reset(input);
assign(output, 'goc.out');rewrite(output);
read(m);
giai;
end.
* Chuyên dạy lập trình ONLINE cho học sinh THCS, THPT *.
Mọi giao lưu, trao đổi, xin liên hệ: Lê Quang Vinh - zalo: 037.803.8755.
Page: Lớp học Code Sky
Group FB1: Ôn thi HSG9 - THTB - TS10 chuyên tin
Group FB2: Học Scratch - Ôn thi Tin học trẻ bảng A
Thứ Tư, 27 tháng 4, 2022
ORIGINAL Pascal
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét
Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.