Early languages like Fortran IV use conditional and unconditional goto statements instead of structured statements like if and while. In Fortran IV, each statement occupies a line of input. The first five positions in each line are reserved for an optional label, which is an integer. The next position is reserved for a continuation marker, which we shall not consider further. Therefore, statements occupy positions 7 and beyond in each input line. The goto statement looks like this
goto label
if(expression)goto label
Your input consists of two programs separated by a blank line. No input line exceeds 80 characters and no program contains more than 1000 lines. Each label used in a goto statement appears to the left of exactly one statment; no label is repeated.
Output consists if a single line, stating either "The programs are equivalent." or "The programs are not equivalent."
read 6, i,k,j 99 if(i .lt. j)goto 33 goto 55 33 i=j goto 99 55 k=j+1 stop read6,i,k,j if(i.lt.j)goto12345 77 k=j+1 goto5555 12345 i=j if(i.lt.j)goto12345 goto77 88 goto88 5555 stop
The programs are equivalent.