Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
764 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

int sum(int a, int b) {
    return a + b;
}
int step(int a, int b) {
    int i = 0;
    int count = 1;
    while (i < b) {
        count *= a;
        i++;
    }
    return count;
}

int krut(int a, int b, int c) {
    int d = sum(a, b);
    int k = step(d, c);
    return k;
}

void stepkrut(string name, int a,int b,int c) {
    int k = krut(a, b, c);
    if (k >= 50) {
        cout << "ну ты и крутой, " << name;
    }
    else if (k < 50) {
        cout << "фу," << name << "слабак";
    }
}

int main()
{   
    setlocale(LC_ALL, "Russian");
    int a, b, c;
    string name;
    cin >> a >> b >> c >> name;
    stepkrut(name,a, b, c);
}
Leave a Comment