diff options
Diffstat (limited to '1_anno/Programmazione_2/algorithms/pow.cc')
-rw-r--r-- | 1_anno/Programmazione_2/algorithms/pow.cc | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/1_anno/Programmazione_2/algorithms/pow.cc b/1_anno/Programmazione_2/algorithms/pow.cc deleted file mode 100644 index 16cf419..0000000 --- a/1_anno/Programmazione_2/algorithms/pow.cc +++ /dev/null @@ -1,25 +0,0 @@ -#include<iostream> - -using namespace std; - -int pow(int x, int y) { - int a = 1; - - for(int i = 0; i < y; ++i) - a*=x; - - return a; -} - - -int pow2(int x, int y) { - if(y < 1) return 1; - - return x*pow(x, y-1); -} - -int main() { - cout << pow(2, 5) << endl; - cout << pow2(2, 5) << endl; - return 0; -} |