VAR i,n :INTEGER; BEGIN Write ('Nhap n:'); Readln(n); Write (n,'='); i:=2; REPEAT WHILE n MOD i <> 0 DO i:=i+1; Write(i); n:=n DIV i; IF n > 1 THEN write ('*'); UNTIL n = 1; readln; END.
uses crt; var n,i: integer; begin clrscr; Write('Nhap so can phan tich: ');Readln(n); i:=2; Write('Ket qua phan tich:'); Write(n,'='); While n>1 do Begin if n mod i = 0 then Begin Write(i,'.'); n:= n div i end else i:=i+1; End; Readln End.