NYOJ-477-A+B Problem III-2013年6月8日00:19:05

来源:互联网 发布:autocut下料软件 编辑:程序博客网 时间:2024/05/18 19:46

A+B Problem III

时间限制:1000 ms  |  内存限制:65535 KB
难度:1
描述
求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 011 -11.25 -0.251 2 +4
样例输出
YesYesNo

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