PAT程序设计考题——甲级1065( A+B and C (64bit) ) C++实现
来源:互联网 发布:软件测试简历范文 编辑:程序博客网 时间:2024/06/05 18:39
点击打开pat链接#include<iostream>
#include<math.h>
#include<algorithm>
#include<map>
#include<stack>
#include<string>
#include<vector>
using namespace std;
#define INF 100000000
#define maxn 100010
int main()
{
long long a,b,c;
int n;bool flag;
cin>>n;
for(int i=0;i<n;i++)
{cin>>a>>b>>c;
long res=a+b;
if(a>0&&b>0&&res<0) flag=true;
else if(a<0&&b<0&&res>=0) flag=false;
else if(res>c) flag=true;
else flag=false;
if(flag) cout<<"Case #"<<i+1<<": true"<<endl;
else cout<<"Case #"<<i+1<<": false"<<endl;;
}
#include<math.h>
#include<algorithm>
#include<map>
#include<stack>
#include<string>
#include<vector>
using namespace std;
#define INF 100000000
#define maxn 100010
int main()
{
long long a,b,c;
int n;bool flag;
cin>>n;
for(int i=0;i<n;i++)
{cin>>a>>b>>c;
long res=a+b;
if(a>0&&b>0&&res<0) flag=true;
else if(a<0&&b<0&&res>=0) flag=false;
else if(res>c) flag=true;
else flag=false;
if(flag) cout<<"Case #"<<i+1<<": true"<<endl;
else cout<<"Case #"<<i+1<<": false"<<endl;;
}
return 0;
}
}
阅读全文
0 0
- PAT程序设计考题——甲级1065( A+B and C (64bit) ) C++实现
- PAT(甲级)1065. A+B and C (64bit)
- PAT甲级.1065. A+B and C (64bit) (20)
- 1065. A+B and C (64bit) (20) PAT 甲级
- 【PAT甲级】1065. A+B and C (64bit) (20)
- PAT甲级1065. A+B and C (64bit) (20)
- 1065. A+B and C (64bit) (20)-PAT甲级
- PAT 甲级 1065. A+B and C (64bit) (20)
- PAT程序设计考题——甲级1001( A+B Format ) C++实现
- PAT程序设计考题——甲级1002(A+B for Polynomials ) C++实现
- PAT程序设计考题——甲级1058(A+B in Hogwarts ) C++实现
- PAT A+B and C (64bit)
- 1065. A+B and C (64bit) (20)-PAT甲级真题
- PAT甲级练习1065. A+B and C (64bit) (20)
- PAT甲级真题及训练集(2)--1065. A+B and C (64bit) (20)
- PAT程序设计考题——甲级1006(Sign In and Sign Out ) C++实现
- PAT程序设计考题——甲级1043(Is It a Binary Search Tree ) C++实现
- PAT程序设计考题——甲级1102( Invert a Binary Tree ) C++实现
- POJ 2031Building a Space Station
- u盘引导 在SSD+HHD配置下安装ubuntu16.04
- Java JDK下载、安装与系统环境变量配置
- opengl 中坐标系to 2D 变换
- centos源
- PAT程序设计考题——甲级1065( A+B and C (64bit) ) C++实现
- NODE.JS socket客户端
- 【iOS】浅析Objective-C中的堆与栈(PDF版)
- macOS上的改键指南--使用Karabiner
- 嵌入式Linux GPIO 操作
- ARM-Linux驱动相关头文件知识点
- 【iOS开发干货】Objective-C基础知识点总结(一)
- Java线程中yield与join方法的区别
- 设计模式六大原则