题解 | #三角形判断#

三角形判断

https://www.nowcoder.com/practice/689ec1e742394e09b1059556fc167b65

#include <stdio.h>
int main()
{
    int a,b,c;
    
  while (  scanf("%d %d %d",&a,&b,&c)!=EOF) 
  {
    
  if((a+b)>c&&(a+c)>b&&(b+c)>a&&(a-b)<c&&(a-c)<b&&(b-c)<a&&(b-a)<c&&(c-a)<b&&(c-b)<c)

  {
    if ((a==b)&&(a==c)) {
        printf("Equilateral triangle!\n");
    
    }
    else if ((a==b&&a!=c)||(a==c&&a!=b)||(c==b&&c!=a)) {
        printf("Isosceles triangle!\n");
    
    }
    else {
    printf("Ordinary triangle!\n");
    }
  }
  else {
  printf("Not a triangle!\n");
  }

}
}//无脑解法

全部评论

相关推荐

07-02 10:44
门头沟学院 C++
码农索隆:太实诚了,告诉hr,你能实习至少6个月
点赞 评论 收藏
分享
点赞 评论 收藏
分享
让资本家给我当牛做马:26的秋招还没开始啊?你找的是实习?实习的话你马上就研三了为什么还要实习?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务