Cod sursa(job #217017)

Utilizator nod_softwareBudisteanu Ionut Alexandru nod_software Data 26 octombrie 2008 18:43:39
Problema Numere 2 Scor 35
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.58 kb
program numere2;
{$APPTYPE CONSOLE}
uses
  SysUtils;

var i,j,n,m,a,b,p:Int64;
    fin,fout:text;
begin
        assign(fin,'numere2.in'); reset(fin);
        assign(fout,'numere2.out'); rewrite(fout);

        Readln(fin,p);
        a:=1; b:=0;
        while  a < p do
        begin
                inc(a);
                while p mod a = 0 do
                begin
                        inc(b);
                        p:=p div a;
                end;
        end;
        writeln(fout,a);
        writeln(fout,b);

        close(fin);
        close(fout);
end.