Адаптировать код с Pascal на C++. var
q, d, n: longint;
isfound: boolean;
begin
readln(n);
isfound := false;
for q := 2 to trunc(sqrt(n)) + 1 do
if n mod q = 0 then
begin
d := n div q;
write(d, ' ', n - d);
isfound := true;
break;
end;
if not isfound then
write(1, ' ', n - 1);
end.