您的位置:首页 > 其它

第二章作业2.30

2015-04-01 17:16 155 查看
#include<iostream>
#include<cmath>
using namespace std;
int sroot(int a)
{
return sqrt(a);
}
long sroot(long b)
{
return sqrt(b);
}
double sroot(double c)
{
return sqrt(c);
}
int main()
{
int a=9;
long b=4566;
double c=62.41;
cout<<a<<"的二次方根为:"<<sroot(a)<<endl;
cout<<b<<"的二次方根为:"<<sroot(b)<<endl;
cout<<c<<"的二次方根为:"<<sroot(c)<<endl;
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: