当前位置:网站首页>1046 punches (15 points)
1046 punches (15 points)
2022-08-11 07:48:00 【Stay a bit】
题目要求:
代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//輸入
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
scanner.nextLine();
int a = 0, b = 0;
for (int i = 0; i < n; i++){
String line = scanner.nextLine();
String[] split = line.split(" ");
int r = Integer.valueOf(split[0]) + Integer.valueOf(split[2]);
//If A and B are equal, continue
if (Integer.valueOf(split[1]) == Integer.valueOf(split[3])) continue;
//喝酒
if (r == Integer.valueOf(split[1]) ){
b += 1;
}else if (r == Integer.valueOf(split[3])){
a += 1;
}
}
System.out.println(a + " " + b);
}
}
结果:
边栏推荐
- Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
- 关于Android Service服务的面试题
- What are the things that should be planned from the beginning when developing a project with Unity?How to avoid a huge pit in the later stage?
- 测试用例很难?有手就行
- Activity的四种启动模式
- TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
- exness:黄金1800关口遇阻,静待美国CPI出炉
- 从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
- Unity3D learning route?
- 接口测试的基础流程和用例设计方法你知道吗?
猜你喜欢
随机推荐
jar服务导致cpu飙升问题-带解决方法
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
DDR4内存条电路设计
关于Excel实现分组求和最全文档
Unity3D learning route?
prometheus学习4Grafana监控mysql&blackbox了解
1061 判断题 (15 分)
你是如何做好Unity项目性能优化的
1096 大美数 (15 分)
C语言每日一练——Day02:求最小公倍数(3种方法)
golang fork 进程的三种方式
NFT 的价值从何而来
TF中的One-hot
数仓开发知识总结
计算YUV文件的PSNR与SSIM
Unity开发者必备的C#脚本技巧
下一代 无线局域网--强健性
JVM学习——3——数据一致性
无服务器+域名也能搭建个人博客?真的,而且很快