专题博客链接
[题解]浙大Python PTA课后习题博客记录(Python)
原题题目
代码实现
复制代码
1
2
3
4
5
6
7
8import math a,b,c = map(int,input().split()) s = (a+b+c)/2 if(a+b>c and b+c>a and a+c>b): print("area = {0:.2f}; perimeter = {1:.2f}".format(math.sqrt(s * (s-a) * (s-b) * (s-c)),2*s)) else: print("These sides do not correspond to a valid triangle")
提交结果
最后
以上就是迷路爆米花最近收集整理的关于浙大Python 第2章-12 输出三角形面积和周长 (15 分)的全部内容,更多相关浙大Python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复