Files
PAT/html/b1046.html
T

33 lines
1.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h1>1046. 划拳(15)</h1>
<div id="problemContent">
<p>
划拳是古老中国酒文化的一个有趣的组成部分。酒桌上两人划拳的方法为:每人口中喊出一个数字,同时用手比划出一个数字。如果谁比划出的数字正好等于两人喊出的数字之和,谁就赢了,输家罚一杯酒。两人同赢或两人同输则继续下一轮,直到唯一的赢家出现。
</p>
<p>下面给出甲、乙两人的划拳记录,请你统计他们最后分别喝了多少杯酒。</p>
<p><b>
输入格式:
</b></p>
<p>
输入第一行先给出一个正整数N(&lt;=100),随后N行,每行给出一轮划拳的记录,格式为:</p>
<p>甲喊 甲划 乙喊 乙划</p>
<p>其中“喊”是喊出的数字,“划”是划出的数字,均为不超过100的正整数(两只手一起划)。
</p>
<p><b>
输出格式:
</b></p>
<p>
在一行中先后输出甲、乙两人喝酒的杯数,其间以一个空格分隔。</p>
<b>输入样例:</b><pre>
5
8 10 9 12
5 10 5 10
3 8 5 12
12 18 1 13
4 16 12 15
</pre>
<b>输出样例:</b><pre>
1 2
</pre>
</div>