發表文章 | 發起投票 |
[低質J圖]pascal jj入
program project1;
var mark:array[1..100] of integer;
i,mf(最高分),ms(第2高),mt(第3高),fs(最高分個學生),ss(第2高),ts(第3高),a(冇用的):integer;
begin
i:=0;
mf:=0;
ms:=0;
mt:=0;
repeat
i:=i+1;
write('Mark of student',i,'(-999 to exit):');
read(mark);
begin
if mark>mf then
begin
mf:=mark;
fs:=i;
end;
if (mark>ss) and (mark<mf) then
begin
ms:=mark;
ss:=i;
end;
if (mark<ts) and (mark>0) then
begin
mt:=mark;
ts:=i;
end;
end;
until mark = -999;
writeln('Test');
writeln('The first prize goes to student ',fs,' with a mark of ',mf);
writeln('The second prize goes to student ',ss,' with a mark of ',ms);
writeln('The third prize goes to student ',ts,' with a mark of ',mt);
readln(a);
end.
[/quote]
點樣搵第2同第3高
http://i.imgur.com/QGgUTQI.jpg
http://i.imgur.com/Iy7xgfN.jpg
http://i.imgur.com/n3C4jiT.jpg
http://i.imgur.com/pZrTNk0.jpg
http://i.imgur.com/S9mOWgD.jpg
本貼文共有 0 個回覆
此貼文已鎖,將不接受回覆
發表文章 | 發起投票 |