美文网首页
B. Three Angles

B. Three Angles

作者: 与卿__歌 | 来源:发表于2017-02-11 10:39 被阅读0次

B. Three Angles
Given three angles, determine if it is possible to have a triangle of positive area with these
angles.
Input
The first line of input contains one integer T, the number of test cases (1 ≤ T ≤ 128).
Each of the following T lines contains 3 space-separated integers (0 ≤ θ1, θ2, θ3 ≤ 180). These
integers represent the three angles.
Output
For each test case, print “YES” if it is possible to have a triangle of positive area with angles (θ1,
θ2, θ3) and print “NO” otherwise.
Sample Input Sample Output
3
50 60 70
50 65 80
45 90 45
YES
NO
YES
题意:
给3个角度,判断是否构成三角形。
思路:
判断三个数相加是否等于180,注意不能为0和负数。

#include<stdio.h>
int main()
{
    int t,a,b,c;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a+b+c==180&&a>0&&b>0&&c>0)
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    }
}

相关文章

  • B. Three Angles

    B. Three AnglesGiven three angles, determine if it is pos...

  • Different angles

    是你认为的青春模样, 是我眼中的灾难现场, 是你眼中的青山白浪, 是我认为的别样颓唐。

  • 欧拉角与四元数

    以前人们都用Euler Angles来描述几何体的旋转,Euler Angles通常包含XYZ三个旋转分量,也就是...

  • A Painting Touching Me...

    Rocks and soil have been carved into cubes and angles in ...

  • 电缆

    Hometown My life's town Los Angles

  • 715 冬日芬芳

    The petals hang resembling the upside-down angles and lig...

  • chapter one-Computer networks an

    1、What is the Internet? Two angles basic hardware and sof...

  • Explanation will imprison our th

    A thing can be explained from different angles. Even if t...

  • 4.4

    210 how could humans creat so many angles when their beha...

  • eular angle

    pytorch3d.transforms.euler_angles_to_matrix详解 ⚠️Attention...

网友评论

      本文标题:B. Three Angles

      本文链接:https://www.haomeiwen.com/subject/yianittx.html