```
class Solution {
public:
int sumNumbers(TreeNode *root) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
static int pathsum = 0;
static int sum = 0;
if (root != NULL) {
pathsum = 10 * pathsum + root->val;
if (root->left == NULL && root->right == NULL)
sum += pathsum;
sumNumbers(root->left);
sumNumbers(root->right);
pathsum = (pathsum - root ->val) /10 ;
}
return sum;
}
};
```

I submit this code, and tell me wrong answer:

Input: {0,1}

Output: 10

Expected: 1

However, when I run my program in VS2010, the answer is 1....