300394: CF75A. Life Without Zeros

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Life Without Zeros

题意翻译

标题:没有0的人生 背景: 你能想象没有0的生活吗?毫无疑问我们会遇到很多问题。 描述: 给你a和b,令c=a+b,询问去掉0后的a和b相加是否等于去掉0后的c。 例如: 若两个数为101和102,101+102=203,去掉0后11+12=23,仍然成立。 若两个数为105和106,105+106=211,去掉0后15+16=31≠211,不成立。 输入: 输入有两行,每行各有一个无前导0的数ai。1≤ai≤1e9。 输出: 输出就一行,如果仍然保持相等则输出"YES"(无引号),否则输出"NO"。 Translated by @gjc1124646822

题目描述

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.

输入输出格式

输入格式


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<=10^{9} $ ). There won't be any leading zeros in both. The value of $ c $ should be calculated as $ c=a+b $ .

输出格式


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.

输入输出样例

输入样例 #1

101
102

输出样例 #1

YES

输入样例 #2

105
106

输出样例 #2

NO

Input

题意翻译

标题:没有0的人生 背景: 你能想象没有0的生活吗?毫无疑问我们会遇到很多问题。 描述: 给你a和b,令c=a+b,询问去掉0后的a和b相加是否等于去掉0后的c。 例如: 若两个数为101和102,101+102=203,去掉0后11+12=23,仍然成立。 若两个数为105和106,105+106=211,去掉0后15+16=31≠211,不成立。 输入: 输入有两行,每行各有一个无前导0的数ai。1≤ai≤1e9。 输出: 输出就一行,如果仍然保持相等则输出"YES"(无引号),否则输出"NO"。 Translated by @gjc1124646822

加入题单

上一题 下一题 算法标签: