#include<stdio.h>
#include<malloc.h>
typedef int Status;
#define OK 1 //执行成功
#define ERROR 0 //执行出错
typedef struct
{
int a,b,c;
} ElemType;
Status GetLength(ElemType a, int *len)
{
if(a.a+a.b<=a.c||a.a+a.c<=a.b||a.b+a.c<=a.a)
return ERROR;
(*len) = a.a+a.b+a.c;
return OK;
}
void ElemInput(ElemType *e) //输入
{
scanf("%d %d %d",&e->a,&e->b,&e->c);
};
void ElemOutput(ElemType e) //输出
{
printf("<%d ,%d ,%d>",e.a,e.b,e.c);
};
int main()
{
ElemType a;
int len;
while(true)
{
ElemInput(&a);
if(GetLength(a,&len)==ERROR)
printf("输入不合法\n");
else
printf("三角形的周长是:%d\n",len);
}
return 0;
}