Skip to content

Commit 96c025b

Browse files
committed
Added 75A - Life Without Zeros.cpp
1 parent 044b116 commit 96c025b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

75A - Life Without Zeros.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
5+
// Code Written By: Vikash Patel
6+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
7+
8+
int main()
9+
{
10+
long long a,b;
11+
cin>>a>>b;
12+
long long c = a+b;
13+
string as = to_string(a);
14+
string bs = to_string(b);
15+
string cs = to_string(c);
16+
as.erase(remove(as.begin(), as.end(), '0'), as.end());
17+
bs.erase(remove(bs.begin(), bs.end(), '0'), bs.end());
18+
cs.erase(remove(cs.begin(), cs.end(), '0'), cs.end());
19+
long long ans = stoll(as)+stoll(bs);
20+
if(ans == stoll(cs))
21+
cout<<"YES"<<endl;
22+
else
23+
cout<<"NO"<<endl;
24+
}

0 commit comments

Comments
 (0)