- /*
- *Copyright (c) 2015,烟台大学计算机学院
- *All rights reserved.
- *文件名称:text.cpp
- *作者:李德彪
- *完成日期:2015年3月31日
- *版本号:v1.0
- *
#include <iostream>
using namespace std;
int sumofSqure(int a,int b);
double sumofSqure(double a,double b);
int main()
{
int m,n;
cout <<"Please put 2 number:"<<endl;
cin >>m>>n;
cout <<"The sum of Square is "<<sumofSqure(m,n)<<endl;double x,y;
cout <<"Please put 2 number:"<<endl;
cin >>x>>y;
cout <<"The sum of Square is "<<sumofSqure(x,y)<<endl;
return 0;
}int sumofSqure(int a,int b)
{
return a*a+b*b;
}
double sumofSqure(double a,double b)
{
return a*a+b*b;
}
重载函数
最新推荐文章于 2022-04-19 11:33:40 发布