Files
CTDL-GT/Lab1_3b.cpp
tienthieusac b0111fce8a Init
2018-10-03 20:51:47 +07:00

26 lines
349 B
C++

#include <iostream>
using namespace std;
long pow(int n, int m)
{
if (m == 0)
{
return 1;
}
else
{
return n * pow(n, m - 1);
}
}
int main()
{
int n, m;
long p;
cout << "Nhap co so: ";
cin >> n;
cout << "Nhap so mu: ";
cin >> m;
p = pow(n, m);
cout << "n ^ m = " << p << endl;
system("pause");
return 0;
}