[理工] [資結]-96高應

看板Grad-ProbAsk作者時間13年前 (2011/03/09 23:03), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/1
Below are two operations. It is assumed that S is an integer stack and x,y,and z are integer variables. What is the output? i) ii) x:=1; y:=1; y:=2; clearstack(S); z:=3; push(S,5); clearstack(S); push(S,7); push(S,x); pop(S,x) push(S,4); x:=x+y; pop(S,z); pop(S,x); push(S,y); push(S,x); push(S,3); push(S,y); push(S,z); push(S,2); pop(S,x); pop(S,y); push(S,4); pop(S,x); push(S,x); while not emptystack(S) do while not emptystack(S) do begin begin pop(S,y); pop(S,x); writeln(y); writeln(x); end; end; writeln('x=',x,'y=',y); 有請高手幫忙 --

03/03 12:58,
推 賴清德第2個字 吳建保 恩?
03/03 12:58

03/03 13:03,
也可以推第二個字
03/03 13:03
-- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.217.48.51

03/09 23:42, , 1F
17975 有唷
03/09 23:42, 1F

03/10 12:18, , 2F
03/10 12:18, 2F
文章代碼(AID): #1DTvRNtR (Grad-ProbAsk)