prove that $\mathbb{Q}^n$is dense subset of $\mathbb{R^n}$

Prove that $\mathbb{Q}^n$is dense subset of $\mathbb{R^n}$ using the fact that $\mathbb{Q}$ is dense subset of $\mathbb{R}$

I know that $\mathbb{Q}$ is dense subset of $\mathbb{R}$ That is, between any two real numbers, there exists a rational number

then how to prove that $\mathbb{Q}^n$is dense subset of $\mathbb{R^n}$


Let $(x_1,\ldots,x_n)\in\mathbb{R}^n$ and let $r>0$. For each $k\in\{1,2,\ldots,n\}$, let $q_k\in\mathbb Q$ be such that$$x_n<q_n<x_n+\frac r{\sqrt n}.$$Then\begin{align}\bigl\|(x_1,\ldots,x_n)-(q_1,\ldots,q_n)\bigr\|&=\sqrt{\sum_{k=1}^n(x_k-q_k)^2}\\&<\sqrt{\sum_{k=1}^n\left(\frac r{\sqrt n}\right)^2}\\&=r.\end{align}


Let $$x=(x_1,x_2,...,x_n)\in \mathbb R^n$$

for each $1\le i \le n$ the interval $$(x_i-\epsilon,x_i+\epsilon)$$ includes a rational point $r_i$

The point $$ r=(r_1,r_2,...,r_n)$$ is included in the open box of size $2\epsilon$ around $x$.

Thus $Q^n$ is dense in $\mathbb R^n.$