标签:
1 #ifndef PYTHAGOREAN_H_ 2 #define PYTHAGOREAN_H_ 3 #include <iostream> 4 class Pythagorean { 5 public: 6 // 打印出边长小于 n 的符合勾股定理的三角形的三边长度 7 // print right triangles‘ sides (sides < n) 8 // 可以指定输出流,默认为std::cout 9 std::ostream& operator()(int n, std::ostream& os = std::cout); 10 }; 11 12 #endif // PYTHAGOREAN_H_
https://github.com/shalliestera/triangle
计算所有小于N的勾股数组合,可以写入txt文件保存,每组占一行。
标签:
原文地址:http://www.cnblogs.com/rurigokou/p/5043668.html