int a=10;
int b=3;
a的b次方怎么写?即int c=10*10*10
还有开平方,立方根怎么开??

解决方案 »

  1.   

    double pow( double x, double y );
    返回结果是x的y次方。
    The pow function computes x raised to the power of y.
      

  2.   

    Calculates the square root.double sqrt( double x );
    返回结果是x的平方根。
      

  3.   

    // sqrt
    template<class T>
         inline valarray<T> sqrt(const valarray<T>& x);// pow
    template<class T>
         inline valarray<T> pow(const valarray<T>& x, const valarray<T>& y);template<class T>
         inline valarray<T> pow(const valarray<T> x, const T& y);template<class T>
         inline valarray<T> pow(const T& x, const valarray<T>& y);