Cod sursa(job #1264186)
| Utilizator | Data | 15 noiembrie 2014 16:29:21 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.27 kb |
#include <fstream>
using namespace std;
ifstream in("lgput.in");
ofstream out("lgput.out");
int main()
{
int n,p;
unsigned long x=0;
in>>n>>p;
x=n;
p-=1;
while(p)
{
x=x*n;
p--;
}
out<<x;
return 0;
}
