Cod sursa(job #2644002)
Utilizator | Luiz Felipe luiz_felipe | Data | 22 august 2020 20:30:31 |
---|---|---|---|
Problema | Numere 2 | Scor | 35 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream>
using namespace std;
ifstream f("numere2.in");
ofstream g("numere2.out");
int main()
{
unsigned long long a, b, p;
f >> b;
a = 2;
unsigned long long aux = b;
while (aux > 1) {
p = 0;
while (!(aux % a)) { ++p; aux /= a; }
if (p && aux == 1) g << a << endl << p;
++a;
if (aux > 1 && a * a > aux) {
g << b << endl << 1;
aux=1;
}
}
f.close(); g.close();
}