Cod sursa(job #1798341)
Utilizator | Data | 5 noiembrie 2016 10:28:53 | |
---|---|---|---|
Problema | GFact | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
int p,q,i,nr=0,x;
int main()
{
ifstream f("gfact.in");
ofstream g("gfact.out");
f>>p>>q;
i=0;
while (nr!=q)
{
i=i+p;
x=i;
while (x%p==0)
{
nr++;
x=x/p;
}
}
g <<i;
return 0;
}