Nyoj 659 Judgment triangle "simple question"

Source: Internet
Author: User


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"

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.