Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - Rectangle
Search - Rectangle - List
DL : 0
在exp6_2.cpp已有圆Circle和长方形Rectangle类的基础上,再定义一个具有类似功能的Triangle(三角形)类(面积公式为p(p-a)(p-b)(p-c)的平方根,其中p=(a+b+c)/2,三角形三边a、b、c)。 ● 再设计一个普通求和函数sum,求这三种图形的面积之和。 ● 在主函数中设计代码,用虚函数分别计算这三种图形(圆半径12.7,长方形25.2×15.0,三角形边长51.4×35.5×26.8)的面积,再调用求和函数求这三种图形的面积之和(正确结果1330.2964供调试时验证),并打印显示出来(结果显示4位小数,参考课本P28)。 -i fkwj fos hkj sj lwjl wlfkjljoiu l qief lqkajlfkaj lrjqa ja flkjalkjfq oh oaj
Date : 2025-12-16 Size : 19kb User : zzy
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.