Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //с функцией max
- #include <iostream>
- using namespace std;
- int max(int m, int n) {
- if (m > n) {
- return m;
- }
- else {
- return n;
- }
- }
- int main()
- {
- int a, b, z;
- cout << "Enter the numbers a & b: \n";
- cin >> a >> b;
- z = max(a, 2 * b) * max(2*a-b,b);
- cout << "Number z = " << z;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement