Wuhan University of Science and Technology acm:1010:0 starting point algorithm 27--judging whether right triangle

Source: Internet
Author: User

Problem Description

Enter three integers representing the three-edge length of the triangle to determine whether the right triangle can be formed

Input

Enter 3 integers a,b,c (multiple sets of data, -5000000<a,b,c<5000000)

Output

If you can compose right triangle, output yes or output no

Sample Input
3 4 5
Sample Output
Yes

1#include <stdio.h>2 intMain ()3 {4     intA, B, C;5      while(SCANF ("%d%d%d", &a,&b,&c)! =EOF)6     {7         if(a>0&& b>0&& c>0&& a+b>c && a+c>b && b+c>a)8         {9             if(a*a+b*b==c*c| | a*a+c*c==b*b| | b*b+c*c==a*a)Tenprintf"yes\n"); One             Else Aprintf"no\n");  -         } -         Else the         { -printf"no\n");  -         } -          +     }     -     return 0; +}

Wuhan University of Science and Technology acm:1010:0 starting point algorithm 27--judging whether right triangle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.