Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
724 B
0
Indexable
Never
#include <iostream>
using namespace std;
int slozhit(int a, int b) 
{
    return a + b;
}
int vichet(int a, int b) 
{
    return a - b;
}
int ymnozhit(int a, int b) 
{
    return a * b;
}
float delit(float a, float b) 
{
    if (b != 0) 
    {
        return a / b;   
    }
    else 
    {
        cout << "NO" << endl;
        return 0;
    }
}
int main() 
{
    int a, b;
    cin >> a >> b;
    int sum = slozhit(a, b);
    int raznost = vichet(a, b);
    int proizv = ymnozhit(a, b);
    float chastnoe = delit(a, b);
    cout << "+: " << sum << endl;
    cout << "-: " << raznost << endl;
    cout << "*: " << proizv << endl;
    cout << "/: " << chastnoe << endl;
    return 0;
}
Leave a Comment