Created
June 10, 2013 19:03
-
-
Save farnoy/5751296 to your computer and use it in GitHub Desktop.
Kody
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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