Ta có: \(a+b+c=9\)
\(\Leftrightarrow\left(a+b+c\right)^2=81\)
\(\Leftrightarrow a^2+b^2+c^2+2ab+2bc+2ac=81\)
\(\Leftrightarrow27+2ab+2bc+2ac=81\)
\(\Leftrightarrow2\left(ab+bc+ac\right)=54\)
\(\Leftrightarrow ab+bc+ac=27\)
mà \(a^2+b^2+c^2=27\)
nên \(a^2+b^2+c^2=ab+ac+bc\)
\(\Leftrightarrow2a^2+2b^2+2c^2=2ab+2ac+2bc\)
\(\Leftrightarrow\left(a^2-2ab+b^2\right)+\left(b^2-2bc+c^2\right)+\left(c^2-2ca+a^2\right)=0\)
\(\Leftrightarrow\left(a-b\right)^2+\left(b-c\right)^2+\left(c-a\right)^2=0\)
\(\Leftrightarrow\left\{{}\begin{matrix}a-b=0\\b-c=0\\c-a=0\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}a=b\\b=c\\c=a\end{matrix}\right.\Leftrightarrow a=b=c\)
mà a+b+c=9
nên a=b=c=3
Ta có: \(B=\left(a-4\right)^{2018}+\left(b-4\right)^{2019}+\left(c-4\right)^{2020}\)
\(=\left(3-4\right)^{2018}+\left(3-4\right)^{2019}+\left(3-4\right)^{2020}\)
\(=\left(-1\right)^{2018}-1^{2019}+\left(-1\right)^{2020}\)
\(=1-1+1\)
\(=1\)
Vậy: B=1