Step 1: Use the relation between maximum and minimum.
For any two real numbers \(a\) and \(b\),
\[
\max\{a,b\}+\min\{a,b\}=a+b
\]
Here,
\[
a=\sin x,\qquad b=\cos x
\]
Therefore,
\[
f(x)+g(x)=\sin x+\cos x
\]
Step 2: Combine the two integrals.
We have
\[
\int_0^{\pi} f(x)\,dx+\int_0^{\pi} g(x)\,dx
\]
\[
=
\int_0^{\pi} \left[f(x)+g(x)\right]\,dx
\]
\[
=
\int_0^{\pi}(\sin x+\cos x)\,dx
\]
Step 3: Evaluate the integral.
\[
\int_0^{\pi}(\sin x+\cos x)\,dx
=
\int_0^{\pi}\sin x\,dx+\int_0^{\pi}\cos x\,dx
\]
Now,
\[
\int_0^{\pi}\sin x\,dx
=
[-\cos x]_0^{\pi}
\]
\[
=
-\cos\pi+\cos0
\]
\[
=
-(-1)+1
\]
\[
=2
\]
Also,
\[
\int_0^{\pi}\cos x\,dx
=
[\sin x]_0^{\pi}
\]
\[
=
\sin\pi-\sin0
\]
\[
=0
\]
Therefore,
\[
\int_0^{\pi}(\sin x+\cos x)\,dx=2+0
\]
\[
=2
\]
Step 4: Final conclusion.
Hence,
\[
\boxed{2}
\]