time limit per test
0.25 smemory limit per test
64 MBinput
standard inputoutput
standard outputYou are given three numbers. Is there a way to replace variables A, B and C with these numbers so the equality A + B = C is correct?
Input
There are three numbers X1, X2 and X3 (1 ≤ Xi ≤ 10100), each on a separate line of input.
Output
Output either "YES", if there is a way to substitute variables A, B and C with given numbers so the equality is correct, or "NO" otherwise.
Examples
Input
1
2
3
Output
YES
Input
1
2
4
Output
YES
Input
1
3
5
Output
NO
数据处理一下,用java简单,用c++麻烦点
c++:
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define Max 105 using namespace std; int flag = 0; char s[3][Max],ans[3][Max]; char s1[Max],s2[Max]; char *add(char *x,char *y) { if(strlen(x) < strlen(y)) { strcpy(s1,y); strcpy(s2,x); } else { strcpy(s1,x); strcpy(s2,y); } int d = 0,i = 0; for(i = 0;i < strlen(s2);i ++) { d += s1[i] - '0' + s2[i] - '0'; s1[i] = d % 10 + '0'; d /= 10; } while(s1[i]) { d += s1[i] - '0'; s1[i ++] = d % 10 + '0'; d /= 10; } if(d) { s1[i ++] = d % 10 + '0'; d /= 10; s1[i] = '