Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL));
- int RemoveZero(int a)
- {
- int sum=0,dig,pos=1;
- while(a)
- {
- dig=a%10;
- a/=10;
- while(dig)
- {
- sum+=(dig*pos);
- pos*=10;
- dig/=10;
- }
- }
- return sum;
- }
- int main()
- {
- int a,b,c;
- fastread();
- cin>>a>>b;
- c=a+b;
- a= RemoveZero(a);
- b=RemoveZero(b);
- c=RemoveZero(c);
- if(a+b==c)
- {
- printf("YES\n");
- }
- else printf("NO\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment