[Cpp]/********************************* Date: * Author: SJF0115 * question: 9 degrees 1048 * question: determining the triangle type * Source * result: AC * question: * conclusion: the sum of the squares of the two shorter sides is greater than the square of the longest side, this triangle is an acute triangle. The sum of the two shorter sides is less than the square of the longest side. This triangle is an acute triangle. The sum of the squares of the two shorter sides is equal to the square of the longest side, this triangle is a right triangle. * *********************************/# include <stdio. h> # include <stdlib. h> int main () {int a, B, c; // freopen ("C: \ Users \ SJF \ Desktop \ acm.txt", "r ", stdin); while (scanf ("% d", & a, & B, & c )! = EOF) {int x = a * a + B * B-c * c; int y = a * a + c * c-B * B; int z = B * B + c * c-a * a; if (x = 0 | y = 0 | z = 0) {printf ("Cartesian triangle \ n");} else if (x> 0 & y> 0 & z> 0) {printf ("acute triangle \ n");} else {printf ("acute triangle \ n") ;}} return 0 ;} /********************************** Date: * Author: SJF0115 * question: 9 degrees 1048 * Title: triangle type judgment * Source: http://ac.jobdu.com/problem.php? Pid = 1048 * result: AC * Meaning: * conclusion: the sum of the squares of the two shorter sides is greater than the square of the longest side. This triangle is an acute triangle; the sum of the squares of the two shorter edges is less than the square of the longest side. This triangle is an acute triangle. The sum of the squares of the two shorter edges is equal to the square of the longest side. This triangle is a right triangle. * *********************************/# include <stdio. h> # include <stdlib. h> int main () {int a, B, c; // freopen ("C: \ Users \ SJF \ Desktop \ acm.txt", "r ", stdin); while (scanf ("% d", & a, & B, & c )! = EOF) {int x = a * a + B * B-c * c; int y = a * a + c * c-B * B; int z = B * B + c * c-a * a; if (x = 0 | y = 0 | z = 0) {printf ("Cartesian triangle \ n");} else if (x> 0 & y> 0 & z> 0) {printf ("acute triangle \ n");} else {printf ("acute triangle \ n") ;}} return 0 ;}