直角三角形

来源:互联网 发布:linux 内核bug 编辑:程序博客网 时间:2024/04/30 08:57
注意=是赋值而==是相等的意思
#include <stdio.h>int main(){float a,b,c;scanf("%f%f%f",&a,&b,&c);if(a+b>c&&b+c>a&&a+c>b){if(a*a==b*b+c*c||b*b==c*c+a*a||c*c==a*a+b*b){printf("yes\n");}else{printf("no\n");}}else{printf("not a triangle\n");}return 0;}


0 0