Untitled

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

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

float vic(int a, int b)
{
	return a - b;
}

float um(int a, int b)
{
	return a * b;
}

float del(int a, int b)
{
	if (a == 0 or b == 0)
	{
		return 0;
	}

	else { return a / b; }
}

float st(int a, int b)
{
	int dimon = a;
	for (int i = 1; i < b; i++)
	{
		dimon *= a;
	}

	return dimon;
}

void cal(int a, int b)
{
	cout << sum(a, b) << endl;
	cout << vic(a, b) << endl;
	cout << um(a, b) <<  endl;
	cout << del(a, b) << endl;
	cout << st(a, b) <<  endl;
}

int main()
{
	int a, b; cin >> a >> b; cal(a, b);

}
Leave a Comment