Problem:
A so simple question has been handed several times, I am also drunk, the topic did not say that the edges are all integers, therefore cannot have int type
TriangleTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 57701 Accepted Submission (s): 19526
Problem description Given three sides, please judge if you can form a triangle.
Input data The first row contains a number m, followed by a M row, one instance per line, containing three positive a,b,c. Which A,b,c <1000;
Output for each test instance, if the three-side length a,b,c can make up a triangle, it outputs yes, otherwise no.
Sample Input
21 2 32) 2 2
Sample Output
NOYES
Code:
Import java.util.*;p ublic class main{public static void Main (string[] args) {Scanner cin=new Scanner (system.in); int n=cin . Nextint (); for (int k=0;k<n;k++) {float a=cin.nextfloat (); float b=cin.nextfloat (); float c=cin.nextfloat (); if (a+b >C&&B+C>A&&C+A>B) System.out.println ("YES"), ElseSystem.out.println ("NO");}}
HDU 20,393 Corner (Java)