Logical

2022-11-18
AND &&
输入三条边的长度,判断是否能够生成一个三角形
#include <stdio.h>
int main()
{
    int a, b, c;
    int res;
    printf("please input 3 number->");
    scanf("%d %d %d", &a, &b, &c);
    res = (a + b) > c && (a + c) > b && (b + c) > a;
    printf("triangle is %d", res);
    return 0;
}