void OutputPow( int iNumber, int iPowNumber )
{
auto MyPow = [ ] ( int _iNumber, int _iPowNumber )
{
int iResult = 1;
for ( unsigned int a = 0; a < _iPowNumber; a++ )
iResult *= _iNumber;
return iResult;
};
// Call pow function, alternative pow( iNumber, iPowNumber )
auto iResult = MyPow( iNumber, iPowNumber );
// With using stl format lib
std::cout << std::format( "{0} число в степени {1} = {2}", iNumber, iPowNumber, iResult ) << std::endl;
}
int main( )
{
int iNumber = 5;
int iPowNumber = 2;
OutputPow( iNumber, iPowNumber );
iNumber = 10;
iPowNumber = 5;
OutputPow( iNumber, iPowNumber );
return 0;
}