九度oj 1048
来源:互联网 发布:海关数据工作 编辑:程序博客网 时间:2024/06/06 15:44
- 题目描述:
给定三角形的三条边,a,b,c。判断该三角形类型。
- 输入:
测试数据有多组,每组输入三角形的三条边。
- 输出:
对于每组输入,输出直角三角形、锐角三角形、或是钝角三角形。
- 样例输入:
3 4 5
- 样例输出:
直角三角形
- 来源:
2009年哈尔滨工业大学计算机研究生机试真题
#include<iostream>#include<math.h>#include<algorithm>using namespace std;int main(){ int a,b,c; int str[4]; while(cin>>a>>b>>c) { str[0]=a; str[1]=b; str[2]=c; sort(str,str+3); double num=(str[0]*str[0]+str[1]*str[1]-str[2]*str[2]); if(num<0) { cout<<"钝角三角形"<<endl; } else if(num>0) { cout<<"锐角三角形"<<endl; } else cout<<"直角三角形"<<endl; } }
0 0
- 九度oj 1048
- 【九度OJ】1048【模拟】
- 【九度OJ】:九度OJ 1050
- 【九度OJ】:九度OJ 1053
- 【九度OJ】:九度OJ 1056
- 【九度OJ】:九度OJ 1059
- 【九度OJ】:九度OJ 1206
- 九度oj 1048 判断三角形类型
- //九度OJ 1048 判断三角形类型
- 九度 OJ 1048:判断三角形类型
- 【九度OJ】:1048 判断三角形类型
- 九度oj--1001和1048
- 九度oj-1048-判断三角形类型
- 九度OJ:1000
- 【九度OJ】 1006
- 九度 OJ 1499
- 九度OJ-1002
- 九度OJ-1003
- (4.1.34)Android侧滑菜单DrawerLayout的使用
- 原码, 反码, 补码 详解
- Html常用字体的格式化
- poj 3468 A Simple Problem with Integers
- ubuntu install NVIDIA driver(Common methods, include how to exit X service)
- 九度oj 1048
- devstack安装报错解决方法:Failure creating NET_ID for xxxxx (ml2+ovs网络模式)
- The high signification of the modified poplar plywood
- Unity3D开发随手笔记
- 递归的应用-组合数求解
- Housewife Wind - POJ 2763 树链刨分
- node Express 创建一个web应用
- 卡尔曼滤波
- iOS部分-UI基础控件 - 01天 入门 第01课 计算机的界面搭建