A+B Problem III
来源:互联网 发布:linux编程实践教程 编辑:程序博客网 时间:2024/05/24 01:36
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>int main(){int n;double a, b, c;scanf("%d",&n);while(n--){scanf("%lf %lf %lf",&a, &b, &c);if (a + b - c >= -0.0001 && a + b - c <= 0.0001) puts("Yes");else puts("No");}return 0;}
0 0
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- A+B Problem III
- 477 A+B Problem III
- ACM-A+B Problem III
- 477 A+B Problem III
- 55.A+B Problem III
- 构建ARM GCC工具链(更新版)
- KMP实现
- POJ-2887(块状链表)
- centos 7 挂载NTFS硬盘
- 【BZOJ 1084】 [SCOI2005]最大子矩阵
- A+B Problem III
- 轻松搭建hadoop-1.2.1集群--快速配置SSH免密码登陆
- 矩阵链乘(Matrix Chain Multiplication)
- 组合博弈(NIM博弈和巴什博奕组合) hdu 1851
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- hdu 3911 Black And White 线段树区间合并
- hdu 2222 ac自动机
- A1006 SignIn and SignOut
- UltraEdit编译C语言程序并运行的示例