当前位置:网站首页>PTA 1046 stroke (15 points)
PTA 1046 stroke (15 points)
2022-06-24 05:10:00 【freesan44】
subject
Boxing is an interesting part of the ancient Chinese wine culture . The method of two people on the wine table is : Shout out a number from each mouth , Draw a number with your hand . If someone's number is exactly equal to the sum of the two Numbers , Whoever wins , The loser gets a glass of wine . Either a win or a loss goes on to the next round , Until the only winner comes along .
So let's give you a 、 The record of two people's rowing , Please count how many glasses of wine they drank at last .
Input format :
Enter the first line to give a positive integer first N(≤100), And then N That's ok , Each line gives a record of one stroke , The format is :
A shout A stroke Ethyl shout B row
Among them, shouting is the number , A stroke is a number drawn out , No more than 100 The positive integer ( Row with both hands ).
Output format :
Output a in a row 、 B. the number of glasses they drink , Separated by a space .
sample input : 5 8 10 9 12 5 10 5 10 3 8 5 12 12 18 1 13 4 16 12 15 No blank lines at the end sample output : 1 2 No blank lines at the end
Their thinking
inputRound = int(input())
# inputRound = 5
aWin = 0
bWin = 0
for i in range(inputRound):
aH,aNum,bH,bNum = map(int, input().split())
# aH, aNum, bH, bNum = map(int, "3 8 5 12".split())
if aNum != bNum:
if aNum == (aH + bH):
aWin += 1
elif bNum == (aH + bH):
bWin += 1
print(str(bWin)+ " " + str(aWin))边栏推荐
- Why do hybrid clouds exist?
- Svg quick start small white article
- cuDNN installation
- Webmeng: create a website you are proud of
- Spirit breath development log (11)
- Use of golang testing framework test
- Real time monitoring: system and application level real-time monitoring based on flow computing Oceanus (Flink)
- Bi-sql - Select
- Tencent conference rest API x-tc-registered parameter policy update notification
- Oracle database prompts no operation permission
猜你喜欢

"Emergency response practice" logparser log analysis practice

What is the new generation cloud computing architecture cipu of Alibaba cloud?

CTF learning notes 17:iwesec file upload vulnerability-02 file name filtering bypass

Loss and optimization of linear regression, machine learning to predict house prices

Analysis on the subjective enthusiasm of post-90s makers' Education

Leetcode question brushing (question 3) - the longest substring without repeated characters

解析后人类时代类人机器人的优越性

少儿编程课程改革后的培养方式

Analyzing the superiority of humanoid robot in the post human era

011_ Cascader cascade selector
随机推荐
Redis pipeline technology speed and efficiency increased by 5 times
少儿编程教育在特定场景中的普及作用
Intensive learning and application of "glory of the king" to complete the application of 7 real worlds other than human players
What is the new generation cloud computing architecture cipu of Alibaba cloud?
Functional advantages of industrial wireless router
The trunk warehouse can also be tob, and Tencent cloud microenterprises do not leave quality behind
cuDNN installation
What is stored in the domain name server? How does the domain name server provide services?
Inventory of common tools used by dry goods | data journalists
What domain name does not need to be filed? What should be done for domain name filing
When remote, your resolution is lower than a × B. Some items may not be displayed on the screen
Introduction to ebpf
Skillfully compiling openwrt routing firmware with pay as you go ECS
Data acquisition gateway intelligent industrial Internet of things
What is the use of domain name cloud resolution? What are the factors for domain name errors
What is the experience of developing an ice 3D music player in 3 minutes?
Precautions for online education and training industry filing
IP and traffic reconciliation tool networktrafficview
What kind of domain name is better? What should enterprises pay attention to when choosing a domain name?
How Clickhouse queries imported data within a specified time period