看板 ck54th317 關於我們 聯絡資訊
#include<stdio.h> int main() { int a, b, c; printf("Input three integers which you think that can construct a triangle:"); scanf("%d %d %d",&a, &b, &c); if(a+b>c && b+c>a && c+a>b) { if(a*a+b*b-c*c>0) printf("These integers you input can construct a 銳角三角形!!!"); if(a*a+b*b-c*c==0) printf("You've matched a 直角三角形!!!"); if(a*a+b*b-c*c<0) printf("These integers you input can construct a 鈍角三角形"); } else printf("Can you imagine a person with no math logic!!??"); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.30.110