problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
luogu::P5717类 参考

洛谷 P5717 【深基3.习8】三角形分类 更多...

#include <luogu.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

洛谷 P5717 【深基3.习8】三角形分类

在文件 luogu.h221 行定义.

成员函数说明

◆ main()

int luogu::P5717::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp588 行定义.

588 {
589 unsigned int e[3];
590 cin >> e[0] >> e[1] >> e[2];
591 sort(e, e + 3);
592 if(e[0] + e[1] <= e[2]) {
593 cout << "Not triangle" << endl;
594 } else {
595 const unsigned int e02 = e[0] * e[0];
596 const unsigned int e12 = e[1] * e[1];
597 const unsigned int e22 = e[2] * e[2];
598 if(e02 + e12 == e[2] * e[2]) {
599 cout << "Right triangle" << endl;
600 } else if(e02 + e12 > e22) {
601 cout << "Acute triangle" << endl;
602 } else if(e02 + e12 < e22) {
603 cout << "Obtuse triangle" << endl;
604 }
605 if(e[0] == e[1]) {
606 cout << "Isosceles triangle" << endl;
607 if(e[1] == e[2]) {
608 cout << "Equilateral triangle" << endl;
609 }
610 }
611 }
612 return 0;
613 }

该类的文档由以下文件生成: