当前位置:网站首页>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);
}
}
结果:
边栏推荐
- Tf中的平方,多次方,开方计算
- Unity游戏排行榜的制作与优化
- 如何选择专业、安全、高性能的远程控制软件
- When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
- Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
- Depth (relay supervision)
- tf.cast(),reduce_min(),reduce_max()
- Internet phone software or consolidation of attack must be "free" calls security clearance
- MindManager2022全新正式免费思维导图更新
- 1046 划拳 (15 分)
猜你喜欢
[Recommender System]: Overview of Collaborative Filtering and Content-Based Filtering
Redis source code: how to view the Redis source code, the order of viewing the Redis source code, the sequence of the source code from the external data structure of Redis to the internal data structu
MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段
A used in the study of EEG ultra scanning analysis process
PIXHAWK飞控使用RTK
Pico neo3在Unity中的交互操作
Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
【软件测试】(北京)字节跳动科技有限公司终面HR面试题
进制转换间的那点事
Redis测试
随机推荐
MySQL 版本升级心得
测试用例很难?有手就行
机器学习总结(二)
cdc连sqlserver异常对象可能有无法序列化的字段 有没有大佬看得懂的 帮忙解答一下
Redis源码-String:Redis String命令、Redis String存储原理、Redis字符串三种编码类型、Redis String SDS源码解析、Redis String应用场景
easyrecovery15数据恢复软件收费吗?功能强大吗?
流式结构化数据计算语言的进化与新选择
STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比
结合均线分析k线图的基本知识
Discourse's Close Topic and Reopen Topic
tf中自减操作;tf.assign_sub()
伦敦银规则有哪些?
MindManager2022全新正式免费思维导图更新
2022-08-09 第四小组 修身课 学习笔记(every day)
A used in the study of EEG ultra scanning analysis process
关于Excel实现分组求和最全文档
linux 安装mysql服务报错
微信小程序功能上新(2022.06.01~2022.08.04)
3GPP LTE/NR信道模型
2022-08-10 第四小组 修身课 学习笔记(every day)