习题2.30

来源:互联网 发布:电子烟发热丝数据 编辑:程序博客网 时间:2024/05/22 14:46
cpp] view plaincopy01.#include<iostream>  02.#include<cmath>  03.using namespace std;  04.double sroot(int m)  05.{  06.    return sqrt(n);  07.}  08.double sroot(long x)  09.{  10.    return sqrt(n);  11.}  12.double sroot(double x)  13.{  14.    return sqrt(x);  15.}  16.int main()  17.{  18.    int m=3;  19.    long n=333333;  20.    double x=33.33;  21.    cout<<"m的二次方根等于"<<sroot(m)<<endl;  22.    cout<<"n的二次方根等于"<<sroot(n)<<endl;  23.    cout<<"x的二次方根等于"<<sroot(x)<<endl;  24.    return 0;  25.}

0 0
原创粉丝点击