当前位置:网站首页>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);
}
}
结果:
边栏推荐
- Production and optimization of Unity game leaderboards
- MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段
- 软件测试主要做什么工作,难不难?
- 【LeetCode每日一题】——682.棒球比赛
- Trill keyword search goods - API
- 技术分享 | 实战演练接口自动化如何处理 Form 请求?
- 【Pytorch】nn.Linear,nn.Conv
- go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
- ssh服务攻防与加固
- maxwell concept
猜你喜欢

tf.cast(),reduce_min(),reduce_max()

常见激活函数及其导数

从何跟踪伦敦金最新行情走势?

MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段

How to choose professional, safe and high-performance remote control software

ssh服务攻防与加固

关于Excel实现分组求和最全文档

机器学习总结(二)
![[Recommender System]: Overview of Collaborative Filtering and Content-Based Filtering](/img/bc/fd2b8282269f460f4be2da78b84c22.png)
[Recommender System]: Overview of Collaborative Filtering and Content-Based Filtering

Taobao product details API interface
随机推荐
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
软件测试基本流程有哪些?北京专业第三方软件检测机构安利
【LeetCode每日一题】——844.比较含退格的字符串
3GPP LTE/NR信道模型
SQL滑动窗口
关于Android Service服务的面试题
1076 Wifi密码 (15 分)
为什么我使用C#操作MySQL进行中文查询失败
matplotlib
Unity游戏排行榜的制作与优化
2022-08-09 第四小组 修身课 学习笔记(every day)
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
【Pytorch】nn.PixelShuffle
Unity3D 学习路线?
【软件测试】(北京)字节跳动科技有限公司二面笔试题
A used in the study of EEG ultra scanning analysis process
你是如何做好Unity项目性能优化的
How to choose professional, safe and high-performance remote control software
prometheus学习4Grafana监控mysql&blackbox了解
项目2-年收入判断