展开全部
#include <stdio.h>
void main()
{
int a,b,c;
puts("please input three integers:");
scanf("%d %d %d",&a,&b,&c);
if(a+b<c)
{
printf("sorry!the three integers can't constitute a triangle!\nBecause %d+%d<%d\n",a,b,c);
return;
}
if(c+b<a)
{
printf("sorry!the three integers can't constitute a triangle!\nBecause %d+%d<%d\n",c,b,a);
return;
}
if(a+c<b)
{
printf("sorry!the three integers can't constitute a triangle!\nBecause %d+%d<%d\n",a,c,b);
return;
}
puts("the three integers can constitute a triangle!");
}
void main()
{
int a,b,c;
puts("please input three integers:");
scanf("%d %d %d",&a,&b,&c);
if(a+b<c)
{
printf("sorry!the three integers can't constitute a triangle!\nBecause %d+%d<%d\n",a,b,c);
return;
}
if(c+b<a)
{
printf("sorry!the three integers can't constitute a triangle!\nBecause %d+%d<%d\n",c,b,a);
return;
}
if(a+c<b)
{
printf("sorry!the three integers can't constitute a triangle!\nBecause %d+%d<%d\n",a,c,b);
return;
}
puts("the three integers can constitute a triangle!");
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询