Cod sursa(job #48642)
Utilizator | Data | 4 aprilie 2007 22:55:45 | |
---|---|---|---|
Problema | Numere 2 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream>
#include<math.h>
using namespace std;
unsigned long long int p;
int main()
{
ifstream fin("numere2.in");
ofstream fout("numere2.out");
int i,j,gasit = 0;
fin>>p;
for(i = 1; i <= p && !gasit ; i++)
{
for(j = 1; j <= p; j++)
if(pow(i,j) == p)
{
fout<<i<<" "<<j;
gasit = 1;
}
}
fin.close();
fout.close();
return 0;
}