here is my code, as for the example [0,1], when I try to "run", it returns "1"(which is the right answer), while I tried to submit, it returned "100",I don't know why?

```
class Solution {
public:
int sumNumbers(TreeNode* root) {
static int out = 0;
if (root == NULL) return out;
stack<pair<TreeNode*, int>> store;
store.push(make_pair(root, out));
while (!store.empty()) {
pair<TreeNode*, int>node = store.top();
store.pop();
int value = node.second;
if (node.first->left == NULL && node.first->right == NULL)
out += value + node.first->val;
if (node.first->right != NULL) {
value = value * 10 + node.first->val;
store.push(make_pair(node.first->right, value));
}
if (node.first->left != NULL) {
value = value * 10 + node.first->val;
store.push(make_pair(node.first->left, value));
}
}
return out;
}
};
```