Cod sursa(job #265870)
| Utilizator | Data | 24 februarie 2009 17:39:42 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.33 kb |
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
long n, p, s;
int i;
ifstream f("lgput.in");
f>>n>>p;
f.close();
s=1;
while(p>0)
{
s=s*n;
p--;
}
ofstream g("lgput.out");
g<<s%1999999973;
g.close();
return 0;
}
