A + B problem III

Source: Internet
Author: User
A + B problem III

Description

Determine whether a + B is equal to C.

 
Input
T group test data. Each data group contains three real numbers A, B, and C (-10000.0 <= A, B <= 10000.0,-20000.0 <= C <= 20000.0) the data must not exceed four digits after the decimal point.
Output
If they are equal, if yes is not equal, no is output.
Sample Input
3-11.1 +11.1 011 -11.25 -0.251 2 +4
Sample output
YesYesNo

 #include <stdio.h>#include <math.h>int main(){    int n;    float a,b,c;    scanf("%d",&n);    while(n--){        scanf("%f%f%f",&a,&b,&c);    if(a+b-c<0.0001&&a+b-c>-0.0001)        printf("Yes\n");    else        printf("No\n");    }    return 0;}        

 

A + B problem III

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.