II. (Full marks 50 points) Let $S$ be a subset of $\{1,2, \cdots, 50\}$ with the following property: the sum of any two distinct elements in $S$ is not divisible by 7. What is the maximum number of elements that $S$ can have?
Divide $\{1,2, \cdots, 50\}$ into 7 classes according to modulo 7:
$$
\begin{array}{l}
k_{1}=\{1,8,15,22,29,36,43,50\}, \\
k_{2}=\{2,9,16,23,30,37,44\}, \\
k_{3}=\{3,10,17,24,31,38,45\}, \\
k_{4}=\{4,11,18,25,32,39,46\}, \\
k_{5}=\{5,12,19,26,33,40,47\}, \\
k_{6}=\{6,13,20,27,34,41,48\}, \\
k_{0}=\{7,14,21,28,35,42,49\} .
\end{array}
$$

We will prove that $S=k_{1} \cup k_{2} \cup k_{3} \cup\{7\}$ is the largest set that meets the requirements.
First, for $a, b \in S, a \neq b$, there are 3 possibilities:
(1) $a, b \in k_{i}(1 \leqslant i \leqslant 3)$, then
$$
a+b \equiv 2 i(\bmod 7),
$$

which means $a+b$ cannot be divisible by 7.
(2) $a \in k_{i}, b \in k_{j}(1 \leqslant i \neq j \leqslant 3)$, then
$$
a+b \equiv i+j(\bmod 7),
$$

which means $a+b$ cannot be divisible by 7.
(3) $a \in k_{i}, b=7(1 \leqslant i \leqslant 3)$, then
$$
a+b=i(\bmod 7),
$$

which means $a+b$ cannot be divisible by 7.
In summary, the sum of any two elements in $S$ cannot be divisible by 7.
Next, we prove that if an element $c$ is added to $S$, there must exist an element in $S$ whose sum with $c$ is divisible by 7.
The added $c$ has 4 possibilities:
(1) $c \in k_{4}$, then the sum of $c$ and an element in $k_{3}$ can be divisible by 7.
(2) $c \in k_{5}$, then the sum of $c$ and an element in $k_{2}$ can be divisible by 7.
(3) $c \in k_{6}$, then the sum of $c$ and an element in $k_{1}$ can be divisible by 7.
(4) $c \in k_{0}$, then the sum of $c$ and 7 can be divisible by 7.
In summary, no more elements can be added to $S$. Therefore, the maximum number of elements in $S$ is
$$
|S|=\left|k_{1}\right|+\left|k_{2}\right|+\left|k_{3}\right|+1=23 .
$$