Answer

Given the FORMAT statement, Fortran is looking for the following kind of input:

aaabbbcccdddeee

where aaa, bbb, ccc, ddd, and eee stand for 3-digit integers. So if you enter

11 22 33 44 55

everything works out OK, since Fortran finds 11 in the first three columns, 22 in the next three columns, and so on. But if you enter

1 2 3 4 5

Fortran finds ``1 2'' in the first three columns, `` 3 `` in the next three columns, ``4 5'' in the next three columns, and then it runs of input. It does the best that it can, but it's not what you might have expected.

Return to lesson.



Hamlet Project
hamlet@cs.utah.edu