zl程序教程

您现在的位置是:首页 >  其它

当前栏目

A+B Problem III

Problem III
2023-09-27 14:21:25 时间

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;
}