mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-04 00:38:13 +08:00
28 lines
980 B
HTML
28 lines
980 B
HTML
<!DOCTYPE html>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||
<h1>1016. 部分A+B (15)</h1>
|
||
<div id="problemContent">
|
||
<p>正整数A的“D<sub>A</sub>(为1位整数)部分”定义为由A中所有D<sub>A</sub>组成的新整数P<sub>A</sub>。例如:给定A = 3862767,D<sub>A</sub> = 6,则A的“6部分”P<sub>A</sub>是66,因为A中有2个6。</p>
|
||
<p>现给定A、D<sub>A</sub>、B、D<sub>B</sub>,请编写程序计算P<sub>A</sub> + P<sub>B</sub>。</p>
|
||
<p><b>
|
||
输入格式:
|
||
</b></p>
|
||
<p>输入在一行中依次给出A、D<sub>A</sub>、B、D<sub>B</sub>,中间以空格分隔,其中0 < A, B < 10<sup>10</sup>。</p>
|
||
<p><b>
|
||
输出格式:
|
||
</b></p>
|
||
<p>在一行中输出P<sub>A</sub> + P<sub>B</sub>的值。
|
||
</p>
|
||
<b>输入样例1:</b><pre>
|
||
3862767 6 13530293 3
|
||
</pre>
|
||
<b>输出样例1:</b><pre>
|
||
399
|
||
</pre>
|
||
<b>输入样例2:</b><pre>
|
||
3862767 1 13530293 8
|
||
</pre>
|
||
<b>输出样例2:</b><pre>
|
||
0
|
||
</pre>
|
||
</div> |