Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std ;
- #define sz(s) int(s.size())
- typedef long long ll ;
- void ABDEL3AL () {
- ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
- #ifndef ONLINE_JUDGE
- freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
- #endif
- }
- int main() {
- ABDEL3AL() ;
- string a , b , c ;
- cin >> a >> b ;
- c = to_string(stoi(a) + stoi(b)) ;
- a.erase(remove(a.begin() , a.end() , '0')) ;
- b.erase(remove(b.begin() , b.end() , '0')) ;
- c.erase(remove(c.begin() , c.end() , '0')) ;
- cout << (stoll(a) + stoll(b) == stoll(c) ? "YES" : "NO") ;
- return 0;
- }
Add Comment
Please, Sign In to add comment