1065. A+B and C (64bit)

本篇博客介绍了一个编程问题:对于三个64位整数A、B和C,判断A+B是否大于C。提供了输入输出规范,并附带了一个C++实现示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1065. A+B and C (64bit) (20)

时间限制
100 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
HOU, Qiming

Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.

Input Specification:

The first line of the input gives the positive number of test cases, T (<=10). Then T test cases follow, each consists of a single line containing three integers A, B and C, separated by single spaces.

Output Specification:

For each test case, output in one line "Case #X: true" if A+B>C, or "Case #X: false" otherwise, where X is the case number (starting from 1).

Sample Input:
3
1 2 3
2 3 4
9223372036854775807 -9223372036854775808 0
Sample Output:
Case #1: false
Case #2: true
Case #3: false
#include<iostream>

using namespace std;

int main()
{
	int n;
	cin>>n;
	long long a,b,c,s;
	bool f;
	for(int i=1;i<=n;i++)
	{
		cin>>a>>b>>c;
		s=a+b;
		if(a>0&&b>0&&s<=0)
			f=true;
		else if(a<0&&b<0&&s>=0)
			f=false;
		else
			f=(s>c);
		if(f)
			cout<<"Case #"<<i<<": "<<"true"<<endl;
		else
			cout<<"Case #"<<i<<": "<<"false"<<endl;
	}
	return 0;
}


Error: Problem: package policycoreutils-python-utils-2.9-19.el8.noarch requires /usr/libexec/platform-python, but none of the providers can be installed - package container-selinux-2:2.179.1-1.module+el8.6.0+785+d1251653.noarch requires policycoreutils-python-utils, but none of the providers can be installed - package platform-python-3.6.8-45.el8.rocky.0.i686 requires python3-libs(x86-32) = 3.6.8-45.el8.rocky.0, but none of the providers can be installed - package platform-python-3.6.8-45.el8.rocky.0.i686 requires libpython3.6m.so.1.0, but none of the providers can be installed - package platform-python-3.6.8-45.el8.rocky.0.x86_64 requires libpython3.6m.so.1.0()(64bit), but none of the providers can be installed - package platform-python-3.6.8-45.el8.rocky.0.x86_64 requires python3-libs(x86-64) = 3.6.8-45.el8.rocky.0, but none of the providers can be installed - package containerd.io-1.6.28-3.1.el8.x86_64 requires container-selinux >= 2:2.74, but none of the providers can be installed - installed package python3-3.7.4-8.oe1.x86_64 obsoletes python3-libs provided by python3-libs-3.6.8-45.el8.rocky.0.i686 - installed package python3-3.7.4-8.oe1.x86_64 obsoletes python3-libs provided by python3-libs-3.6.8-45.el8.rocky.0.x86_64 - conflicting requests - problem with installed package python3-3.7.4-8.oe1.x86_64 - package container-selinux-2:2.124.0-1.gitf958d0c.module+el8.5.0+681+c9a1951f.noarch is excluded - package container-selinux-2:2.130.0-1.module+el8.5.0+770+e2f49861.noarch is excluded - package container-selinux-2:2.178.0-1.module+el8.6.0+784+32aef5de.noarch is excluded - package container-selinux-2:2.178.0-2.module+el8.6.0+783+10209741.noarch is excluded (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
最新发布
07-12
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值