Zadania z dziś
This commit is contained in:
14
Laboratorium/20221109155432/ntapotega.cpp
Normal file
14
Laboratorium/20221109155432/ntapotega.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <iostream>
|
||||
|
||||
double potega(int wykladnik, double podstawa){
|
||||
double podstawa_old = 1;
|
||||
for (int i = 0; i < wykladnik; i++) {
|
||||
podstawa_old *= podstawa;
|
||||
}
|
||||
return podstawa_old;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << potega(3, 21.5) << std::endl;
|
||||
}
|
||||
Reference in New Issue
Block a user