运行结果:
C语言代码:
/* c how to program 习题3.44 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//分别定义三条边长变量a,b,c
int a, b, c;
printf("请分别请入三条边a b c的值:");
scanf("%d%d%d", &a, &b, &c);
if( a * a == b * b + c * c || b * b == a * a + c * c || c * c == a * a + b * b )
printf("a,b,c三条边可以组成一个直角三角形\n");
else
printf("a,b,c三条边无法组成一个直角三角形\n");
}