Skip to content

Instantly share code, notes, and snippets.

@farnoy
Created June 10, 2013 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farnoy/5751296 to your computer and use it in GitHub Desktop.
Save farnoy/5751296 to your computer and use it in GitHub Desktop.
Kody
// Iteracyjne
long long potega(double a, int n)
{
long long w=a;
for (int i = 1; i < n; i++) w *= a;
return wynik;
}
// Rekurencyjne
long long potega(double a, int n)
{
if (n == 0) return 1;
else return potega(a, n-1)*a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment