a) Replace each letter in the following sum by a digit from $0$ to $9$, in such a way that the sum is correct.

$\tab$ $\tab$ $ABC$
$\tab$ $\tab$ $DEF$
[u]$+GHI$[/u]
$\tab$ $\tab$ $\tab$ $J J J$

Different letters must be replaced by different digits, and equal letters must be replaced by equal digits. Numbers $ABC$, $DEF$, $GHI$ and $JJJ$ cannot begin by $0$.

b) Determine how many triples of numbers $(ABC,DEF,GHI)$ can be formed under the conditions given in a).
1. **Identify the constraints and initial conditions:**
   - We need to replace each letter in the sum \(ABC + DEF + GHI = JJJ\) with digits from 0 to 9.
   - Different letters must be replaced by different digits, and equal letters must be replaced by equal digits.
   - Numbers \(ABC\), \(DEF\), \(GHI\), and \(JJJ\) cannot begin with 0.
   - \(J\) must be the same digit in all three places of \(JJJ\).

2. **Analyze the sum \(ABC + DEF + GHI = JJJ\):**
   - Since \(JJJ\) is a three-digit number with all digits the same, it must be a multiple of 111.
   - Therefore, \(JJJ = 111 \times k\) for some integer \(k\).
   - The possible values for \(JJJ\) are 111, 222, 333, 444, 555, 666, 777, 888, and 999.

3. **Determine the value of \(J\):**
   - Since \(ABC\), \(DEF\), and \(GHI\) are all three-digit numbers, their sum must be at least 100 and at most 2997.
   - Therefore, \(J\) must be 9 because \(999\) is the only value that fits the constraints (i.e., \(999\) is the largest three-digit number with all digits the same).

4. **Set up the equations:**
   - Let \(A, B, C, D, E, F, G, H, I\) be the digits such that \(ABC + DEF + GHI = 999\).
   - We need to ensure that the sum of the digits in each column results in the correct carryover.

5. **Analyze the possible values for \(A, D, G\):**
   - Since \(A, D, G\) are the leading digits, they cannot be 0.
   - We assume \(A < D < G\) without loss of generality.
   - The sum \(A + D + G\) must be less than or equal to 9 to avoid a carryover to the next column.

6. **Case analysis for \(A, D, G\):**
   - If \(A = 1\), then \(D + G \leq 8\).
   - Possible pairs \((D, G)\) are \((2, 5)\), \((3, 4)\), \((2, 6)\), and \((3, 5)\).

7. **Determine the values for \(B, E, H\) and \(C, F, I\):**
   - We need to ensure that the sum of the digits in the middle and right columns results in the correct carryover.
   - Let \(c_1\) be the carry from the rightmost column to the middle column, and \(c_2\) be the carry from the middle column to the leftmost column.
   - We have the following equations:
     \[
     C + F + I = 10c_1 + 9
     \]
     \[
     B + E + H + c_1 = 10c_2 + 9
     \]
     \[
     1 + D + G + c_2 = 9
     \]
   - Adding these equations, we get:
     \[
     C + F + I + B + E + H + D + G = 9c_1 + 9c_2 + 26
     \]
   - Since \(C + F + I + B + E + H + D + G = 45 - A - J = 35\), we have:
     \[
     35 = 9c_1 + 9c_2 + 26 \implies c_1 + c_2 = 1
     \]

8. **Solve for the possible values:**
   - Either \(c_1 = 0\) and \(c_2 = 1\), or \(c_1 = 1\) and \(c_2 = 0\).
   - This gives us two cases to consider:
     - \(C + F + I = 9\) and \(B + E + H = 19\)
     - \(C + F + I = 19\) and \(B + E + H = 8\)

9. **Check the possible combinations:**
   - For each combination of \(A, D, G\), we need to find valid combinations of \(B, E, H\) and \(C, F, I\) that satisfy the equations.

10. **Count the number of valid triples:**
    - For each valid combination of \(A, D, G\), there are \(3!\) permutations.
    - Similarly, for each valid combination of \(B, E, H\) and \(C, F, I\), there are \(3!\) permutations.
    - Therefore, the total number of valid triples is \(4 \times (3!)^3 = 4 \times 6^3 = 4 \times 216 = 864\).

The final answer is \(\boxed{864}\).