怎么删除百度全家桶:判断三角形(等腰、等边、直角)

来源:百度文库 编辑:高校问答 时间:2024/05/09 13:02:04
要求用C写的,三角形三条边分别为a,b,c

送10分答谢

不会英文
#include<stdio.h>
void main()
{
int a,b,c,t;
void fun(int x,int y,int z);
printf("please input a、b、c:\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{t=a;a=b;b=t;}
if(a>c)
{t=a;a=c;c=t;}
if(b>c)
{t=b;b=c;c=t;}
fun(a,b,c);
}

void fun(int x,int y,int z)
{
if(y+x>z) //因为排过序,两个小数的和大于第3边就好
if(x==y&&y==z)
printf("dengbian");
else if(x==y||y==z)
printf("dengyao");
else if(x*x+y*y==z*z)
if(x==y)
printf("dengyao zhijiao");
else printf("zhijiao");
else printf("pu tong");
else printf("date error");
}