摘要:
#ifndef POW3_H#define POW3_Htemplate class Pow3{public: enum{result = 3 * Pow3::result};};templateclass Pow3{public: enum{result = 1};};#endif此代码计算三的N次方。#ifndef POW3_H#define POW3_Htemplate class Sqrt{public: enum{mid = (LO + HI + 1)/2}; enum{result = (N ::result:Sqrt::result};};templateclass Sqrt{p 阅读全文