【C++_Practice_函数嵌套】输入两个整数,求平方和

/*
 输入两个整数,求平方和
 */

#include <iostream>
using namespace std;

int fun2(int m)
{
    return m * m;
}

int fun1(int x, int y)
{
    return fun2(x) + fun2(y);
}

int main()
{
    int a, b;
    cout << "Please enter two integers(a and b): ";
    cin >> a >> b;
    cout << "The sum of square of a and b: " << fun1(a, b) << endl;
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_30638419/article/details/85339929