标签:调用 oat 重载 str cin ios roo pre cout
/*
time:2020年4月16日21:01:50
where:gfdx
function:重载函数调用---sqrt函数使用*/
#include<iostream>
#include<cmath>
using namespace std;
//重载1
float sroot(float a)
{
return sqrt(a);
}
//重载2
int sroot(int a)
{
return sqrt(a);
}
//重载3
double sroot(double a)
{
return sqrt(a);
}
int main() {
int a;
cin >>a;
cout <<sqrt(a) << endl;//输出重载函数
return 0;
}
标签:调用 oat 重载 str cin ios roo pre cout
原文地址:https://www.cnblogs.com/qq1480040000/p/12716044.html