题目链接

https://www.patest.cn/contests/pat-a-practise/1065

思路

因为 a 和 b 都是 在 long long 范围内的

但是 a + b 可能会溢出 long long 但是 不会溢出 long double

所以 用long double 就能轻松解决了

或者 用大数加法 也行

AC代码

#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <limits> #define CLR(a) memset(a, 0, sizeof(a))
#define pb push_back using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll; const double PI = 3.14159265358979323846264338327;
const double E = exp(1);
const double eps = 1e-6; const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7; int main()
{
int t;
cin >> t;
int count = 1;
while (t--)
{
ld a, b, c;
scanf("%Lf%Lf%Lf", &a, &b, &c);
printf("Case #%d: ", count++);
if (a + b > c)
cout << "true\n";
else
cout << "false\n";
}
}

最新文章

  1. UGUI 学习笔记
  2. 利用jQueryRotate旋转插件开发大转盘抽奖
  3. Postgresql 迁移随笔一
  4. PHP命名空间的作用、为什么使用命名空间?
  5. asp.net core csrf
  6. ABAP 内表的行列转换-发货通知单-SLIS
  7. (转) CCTextFieldTTF输入框
  8. [转帖]迅为4412开发板最小linux系统的存储空间修改
  9. 【转】const 是左结合的,若左边为空,则再向右结合
  10. Gradle 用法总结
  11. 【源代码】LinkedList源代码分析
  12. ssh下常用操作汇总(good)
  13. HDU 5884 Sort
  14. jquery的2.0.3版本源码系列(5):349-817行,extend添加的工具方法
  15. 神奇的Python
  16. Linux下的crontab定时执行任务命令详解(参考:https://www.cnblogs.com/longjshz/p/5779215.html)
  17. 多条件分类统计group by 显示数目为0的类别
  18. SQlite的结构——存储管理
  19. mac下安装安卓开发环境
  20. [CNN] Understanding Convolution

热门文章

  1. PHP计算两个时间的年数、月数以及天数
  2. Flutter接入极光推送
  3. TestNG的參数化測试、共享线程池配置、參数默认值配置
  4. UVA1406 - A Sequence of Numbers(树状数组)
  5. vue.js+koa2项目实战(四)搭建koa2服务端
  6. iOS陆哥开发笔记(七) (AVFoundation简单介绍)
  7. 在SAE安装原版WORDPRESS(图文讲解)
  8. 33:字符统计SumOfCharactors
  9. PHP session回收机制(转)
  10. C语言 包含结构的结构