Wuhan University of Science and Technology acm:1004: Chinese Edition C language Programming tutorial (second Edition) Exercise 5.6

Source: Internet
Author: User

Problem Description

This day the teacher again to small Hao out a topic: give you three lengths, respectively, A,b,c match, let you calculate the three matches can make up of the Triangle area.

Input

Enter each row to include three number a,b,c.

Output

The area of the output triangle for each row (reserved three decimal places), cannot be composed of triangles told the small Hao output "no!".

Sample Input
1 2 33) 4 5
Sample Output
no!6.000
HINT
1#include <stdio.h>2#include <math.h>3 intMain ()4 {5     Doubles,a,b,c,p;6      while(SCANF ("%LF%LF%LF", &a,&b,&c)! =EOF)7     {8         if(a+b>c&&a+c>b&&c+b>a)9         {Tenp= (A+B+C)/2; Onep=p* (P-A) * (p-b) * (P-c); As=sqrt (p); -printf"%.3lf\n", s); -         } the         Elseprintf"no!\n"); -          -     } -      +     return 0; -}

Wuhan University of Science and Technology acm:1004: Chinese Edition C language Programming tutorial (second Edition) Exercise 5.6

Related Article

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.