1120: 零起点学算法27——判断是否直角三角形

1120: 零起点学算法27——判断是否直角三角形

Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lld
Submitted: 5747  Accepted: 1519
[Submit][Status][Web Board]

Description

输入三个整数,分别代表三角形的三条边长度,判断能否构成直角三角形

 

Input

输入3个整数a,b,c(多组数据,-5000000<a,b,c<5000000)

 

Output

如果能组成直角三角形,输出yes否则输出no

 

Sample Input

 
3 4 5

 

Sample Output

yes

 

Source

 
 1 #include<stdio.h>
 2 int main(){
 3     int a,b,c;
 4     while(scanf("%d%d%d",&a,&b,&c)!=EOF){
 5         if((a+b>c)&&(a+c>b)&&(b+c>a))
 6         printf("yes\n");
 7         else
 8         printf("no\n");
 9     }
10     return 0;
11 }

 

posted @ 2017-04-07 01:12  Dollis  阅读(1814)  评论(0编辑  收藏  举报