码迷,mamicode.com
首页 > 其他好文 > 详细

A+B Problem III

时间:2014-11-02 18:13:08      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   sp   strong   数据   div   on   

A+B Problem III

描述

求A+B是否与C相等。

 
输入
T组测试数据。 每组数据中有三个实数A,B,C(-10000.0<=A,B<=10000.0,-20000.0<=C<=20000.0) 数据保证小数点后不超过4位。
输出
如果相等则输出Yes 不相等则输出No
样例输入
3
-11.1 +11.1 0
11 -11.25 -0.25
1 2 +4
样例输出
Yes
Yes
No

 
#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

标签:style   blog   io   color   sp   strong   数据   div   on   

原文地址:http://www.cnblogs.com/imwtr/p/4069601.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!