\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{shapes, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width =3cm, minimum height = 1cm, text centred, draw black, fill = red !30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width =3cm, minimum height = 1cm, text centred, draw black, fill = blue !30]
\tikzstyle{process} = [rectangle, minimum width =3cm, minimum height = 1cm, text centred, draw black, fill = orange !30]
\tikzstyle{decision} = [dimond, minimum width =3cm, minimum height = 1cm, text centred, draw black, fill = green !30]
\tikzstyle{arrow} = [thick,->, >=stealth]
\begin{document}
\begin{tikzpicture}[node distance = 2cm]
node (start)[startstop]{start};
node (in1)[io, below of= start]{Input};
node (pro1)[process, below of = in1]{Process};
node (dec1)[decision, below of = pro1, yshift = -0.5cm]{Decision}
node (pro2a)[process, below of = dec1, yshift = -0.5cm]{Process 2a};
node (pro2b)[process, right of = dec1, xshift = 2cm]{Process 2b};
node (out1)[io, below of = pro2a]{output};
node (stop)[startstop, below of = out1]{Stop};
%\draw [arrow](start)--(in1);
%\draw [arrow](in1)--(pro1);
%\draw [arrow](pro1)--(dec1);
%\draw [arrow](dec1)--node[anchor=east]{Yes}(pro2a);
%\draw [arrow](dec1)--node[anchor=south]{No}(pro2b);
%\draw [arrow](pro2b)--(pro1);
%\draw [arrow](pro2a)--(out1);
%\draw [arrow](out1)--(stop);
\end{tikzpicture}
\end{document}
答案1
大量语法错误;-)
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{graphicx}
\usetikzlibrary{shapes, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width =3cm, minimum height = 1cm, draw = black, fill = red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width =3cm, minimum height = 1cm, draw=black, fill = blue!30]
\tikzstyle{process} = [rectangle, minimum width =3cm, minimum height = 1cm, draw=black, fill = orange!30]
\tikzstyle{decision} = [diamond, minimum width =3cm, minimum height = 1cm, draw=black, fill = green!30]
\tikzstyle{arrow} = [thick,->, >=stealth]
\begin{document}
\begin{tikzpicture}[node distance = 2cm]
\node (start)[startstop]{start};
\node (in1)[io, below of= start]{Input};
\node (pro1)[process, below of = in1]{Process};
\node (dec1)[decision, below of = pro1, yshift = -0.5cm]{Decision};
\node (pro2a)[process, below of = dec1, yshift = -0.5cm]{Process 2a};
\node (pro2b)[process, right of = dec1, xshift = 2cm]{Process 2b};
\node (out1)[io, below of = pro2a]{output};
\node (stop)[startstop, below of = out1]{Stop};
\draw [arrow](start)--(in1);
\draw [arrow](in1)--(pro1);
\draw [arrow](pro1)--(dec1);
\draw [arrow](dec1)--node[anchor=east]{Yes}(pro2a);
\draw [arrow](dec1)--node[anchor=south]{No}(pro2b);
\draw [arrow](pro2b)--(pro1);
\draw [arrow](pro2a)--(out1);
\draw [arrow](out1)--(stop);
\end{tikzpicture}
\end{document}