CF75A.Life Without Zeros
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Can you imagine our life if we removed all zeros from it? For sure we will have many problems.
In this problem we will have a simple example if we removed all zeros from our life, it's the addition operation. Let's assume you are given this equation a + b = c, where a and b are positive integers, and c is the sum of a and b. Now let's remove all zeros from this equation. Will the equation remain correct after removing all zeros?
For example if the equation is 101 + 102 = 203, if we removed all zeros it will be 11 + 12 = 23 which is still a correct equation.
But if the equation is 105 + 106 = 211, if we removed all zeros it will be 15 + 16 = 211 which is not a correct equation.
试想一下,如果我们从生活中去掉所有的数字 0,生活会变成什么样?毫无疑问,我们将面临诸多问题。
本题将给出一个简单的例子:如果从我们的生活中去掉所有数字 0,那么加法运算会发生什么变化。假设你被给定如下等式:a+b=c,其中 a 和 b 是正整数,c 是 a 与 b 的和。现在,让我们从该等式中去掉所有的数字 0。去掉所有 0 后,该等式是否仍然成立?
例如,若原等式为 101+102=203,去掉所有 0 后变为 11+12=23,这仍然是一个正确的等式。
但若原等式为 105+106=211,去掉所有 0 后变为 15+16=211,这就不再是一个正确的等式了。
输入格式
The input will consist of two lines, the first line will contain the integer a, and the second line will contain the integer b which are in the equation as described above (1 ≤ a, b ≤ 109). There won't be any leading zeros in both. The value of c should be calculated as c = a + b.
输入包含两行,第一行包含整数 a,第二行包含整数 b,它们即为上述方程中的参数(1 ≤ a,b ≤ 109)。a 和 b 均不含前导零。需按 c = a + b 计算 c 的值。
输出格式
The output will be just one line, you should print "YES" if the equation will remain correct after removing all zeros, and print "NO" otherwise.
输出仅一行,如果移除所有数字 0 后等式仍然成立,则输出 “YES”,否则输出 “NO”。
输入输出样例
输入#1
101 102
输出#1
YES
输入#2
105 106
输出#2
NO
输入解题思路,AI测评打分。不知道怎么写?