Untitled

 avatar
user_5811307
plain_text
2 months ago
785 B
0
Indexable
Never
#include <iostream>
#include <cmath>
#include <string>
#include <vector>

using namespace std;

int sum(int a, int b)
{
    return a+b;
}

int min(int a, int b)
{
    return a-b;
}

int umnog(int a, int b)
{
    return a*b;
}

int stepin(int a, int b)
{
    return pow(a,b);
}

int delen(int a, int b)
{
    return a/b;
}

int main()
{
    float a = 0,b=0;
    char s;
    cin >> a;
    cin >> s;
    cin >> b;
    
    switch(s)
    {
        case '+':
            cout << sum(a,b)<< endl;
            break;
        case '-':
            cout << min(a,b)<< endl;
            break;
        case '/':
            cout << delen(a,b)<< endl;
            break;
        case '^':
            cout << stepin(a,b)<< endl;
            break;
        default:
                break;
    }
}
Leave a Comment