Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
711 B
1
Indexable
Never
#include <iostream>
using namespace std;
double power(double A, int B) 
{
    if (B == 0) 
    {
        return 1;
    }
    else {
        double result = A;
        for (int i = 1; i < B; i++) 
        {
            result *= A;
        }
        return result;
    }
}
int calculatekrytost(int press, int fives, int weight)
{
    int k = power(press + weight, fives);
    return k;
}
int main() 
{
    int press, fives, weight;
    cout << "cubes: ";
    cin >> press;
    cout << "fives: ";
    cin >> fives;
    cout << "weight bar: ";
    cin >> weight;
    int krytost = calculatekrytost(press, fives, weight);
    cout << "krytost: " << krytost << endl;
    return 0;
}
Leave a Comment