\documentclass{article}

\usepackage{verbatim}
\usepackage{fancyvrb} % \begin{Verbatim}[tabsize=4]

\begin{document}

Some text

% You cannot use tabs! only spaces!
\begin{verbatim} 
for (int i = 1; i <= n; i++)
  for (int j = 1; j <= n; j++)
    for (int k = 1; k <= n; k++)
      d[i,j] |= d[i,k] & d[k,j]
\end{verbatim}

Some more text

\verbatiminput{a.cpp} %\usepackage{verbatim} 

Some more text

\begin{verbatim}
verbatim
	does not like
		tabs
\end{verbatim}

% Tabs! If you wanna tabs, use this one
% \usepackage{fancyvrb}
\begin{Verbatim}[tabsize=4]
Verbatim
	does
    and spaces too
\end{Verbatim}

\end{document}
