pascal 语言
读入6个数,打印出其中的最大数和最小数,两个数之间隔一空格。这个题目怎么做啊??
program Project2; {$APPTYPE CONSOLE} uses SysUtils; var i:integer; p:array[1..6] of integer; min:integer; max:integer; begin writeln('请输入数据:'); for i:=1 to 6 do begin readln(p[i]); end; min:=p[1]; max:=p[1]; for i:=1 to 6 do begin if(p[i]<min) then min:=p[i]; if(p[i]>max) then max:=p[i]; end; write('最大:'); writeln(max); write('最小:'); writeln(min); end.