For a positive integer $n$, let $S(n), P(n)$ denote the sum and the product of all the digits of $n$ respectively.
1) Find all values of n such that $n = P(n)$:
2) Determine all values of n such that $n = S(n) + P(n)$.
### Part 1: Finding all values of \( n \) such that \( n = P(n) \)

1. Let \( n \) be a positive integer with \( k \) digits. Denote the digits of \( n \) as \( a_1, a_2, \ldots, a_k \).
2. The product of the digits of \( n \) is \( P(n) = a_1 \cdot a_2 \cdot \ldots \cdot a_k \).
3. If \( k > 1 \), then the smallest possible value of \( n \) is \( 10^{k-1} \) (since \( n \) has \( k \) digits).
4. The largest possible value of \( P(n) \) is \( 9^{k-1} \) (since the maximum digit is 9).
5. Therefore, we have:
   \[
   10^{k-1} \leq n = P(n) \leq 9^{k-1}
   \]
6. For \( k > 1 \), this inequality is a contradiction because \( 10^{k-1} > 9^{k-1} \). Hence, \( k \) must be 1.
7. If \( k = 1 \), then \( n \) is a single digit number, and \( P(n) = n \). Therefore, \( n \) can be any digit from 1 to 9.

### Conclusion for Part 1:
\[
\boxed{\{1, 2, 3, 4, 5, 6, 7, 8, 9\}}
\]

### Part 2: Determining all values of \( n \) such that \( n = S(n) + P(n) \)

1. Let \( n \) be a positive integer with \( k \) digits. Denote the digits of \( n \) as \( a_1, a_2, \ldots, a_k \).
2. The sum of the digits of \( n \) is \( S(n) = a_1 + a_2 + \ldots + a_k \).
3. The product of the digits of \( n \) is \( P(n) = a_1 \cdot a_2 \cdot \ldots \cdot a_k \).
4. We need to find \( n \) such that:
   \[
   n = S(n) + P(n)
   \]
5. If \( k > 1 \), then the smallest possible value of \( n \) is \( 10^{k-1} \).
6. The largest possible value of \( S(n) + P(n) \) is \( 9k + 9^{k-1} \).
7. Therefore, we have:
   \[
   10^{k-1} \leq n = S(n) + P(n) \leq 9k + 9^{k-1}
   \]
8. Simplifying the inequality:
   \[
   10^{k-1} \leq 9k + 9^{k-1}
   \]
9. For \( k = 1 \):
   \[
   n = a \quad \text{and} \quad n = a + a \implies a = 2a \implies a = 0 \quad \text{(impossible for positive } n)
   \]
10. For \( k = 2 \):
    \[
    n = 10a + b \quad \text{and} \quad 10a + b = a + b + ab \implies 10a = a + ab \implies 9a = ab \implies b = 9
    \]
    Therefore, \( n = 10a + 9 \) for \( a = 1, 2, \ldots, 9 \). This gives us the numbers \( 19, 29, \ldots, 99 \).
11. For \( k = 3 \):
    \[
    n = 100a + 10b + c \quad \text{and} \quad 100a + 10b + c = a + b + c + abc
    \]
    Simplifying:
    \[
    100a + 10b + c = a + b + c + abc \implies 99a + 9b = abc
    \]
    This implies:
    \[
    99a \leq abc \leq 81a \quad \text{(since } a, b, c \leq 9)
    \]
    This is a contradiction, so there are no solutions for \( k = 3 \).

### Conclusion for Part 2:
\[
\boxed{\{19, 29, 39, 49, 59, 69, 79, 89, 99\}}
\]