To determine the triangle time limit: +Ms | Memory Limit:65535KB Difficulty:2
-
-
Describe
-
Xiao Ming likes to study triangles very much. Now, Xiaoming already knew three sides of the triangle, if three side can compose the triangle, xiaoming will be very happy, he will get a "YE", if he after further research know it is isosceles triangle again,
He will have a "ye", he again study it is a equilateral triangle, of course, he will get a "ye."
Xiaoming certainly didn't want to judge by himself! Then ask you to help him write a program calculated to give you three sides Xiao Ming will get a few "YE"?
Tip 1: The last common triangle gets one, Isosceles gets two, the equilateral gets three
Tip 2: Please press the output format exactly as shown below
-
Input
-
First, enter a T, which represents a few sets of test data.
Next there are t-lines, each with three numbers representing three edges.
-
Output
-
For each set of test data first output "case #H:" H represents the group of test data, followed by the output of Xiao Ming "YE"
Number, if Xiaoming does not get "YE", please output "no".
-
Sample input
-
2
-
3 3 2
-
5 2 1
-
Sample output
-
Case #1:
-
Ye Ye
-
Case #2:
-
NO
#include <stdio.h>int main () {int s,a,b,c;int t=1;scanf ("%d", &s), while (s--) {scanf ("%d%d%d", &a,&b, &C);p rintf ("Case #%d:\n", t++), if (a+b>c&&a+c>b&&b+c>a) {printf ("YE"); if (a==b| | a==c| | B==C) printf ("Ye"); if (a==b&&a==c) printf ("Ye");} elseprintf ("NO");p rintf ("\ n");} return 0;}
Nyoj 659 Judgment triangle "simple question"