identification division.
program-id. quick.
environment division.
data division.
working-storage section.
01 temp-val1 pic 9 value 1.
01 temp-val2 pic 9 value 2.
procedure division.
mainline.
perform encrypt.
stop run.
encrypt.
if (temp-val1 = 1)
display "1"
display "2".
end_if.
if (temp-val2 = 2)
display "2"
display "1".
end_if.
display "outside the ifs".
程序的输出很简单:
1
2
但我希望:
1
2
2
1
在 ifs 之外
我究竟做错了什么?我是否误解了第一个 if 中语句的句子结构或句号的位置?