home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
historic
/
v941.tgz
/
icon.v941src.tar
/
icon.v941src
/
ipl
/
progs
/
ll.icn
< prev
next >
Wrap
Text File
|
2000-07-29
|
836b
|
37 lines
############################################################################
#
# File: ll.icn
#
# Subject: Program to list shortest and longest lines in a file
#
# Author: Ralph E. Griswold
#
# Date: June 12, 1999
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program reads a file from standard input and writes out the
# lengths of the shortest and longest lines in it.
#
############################################################################
procedure main()
local length, max, min
max := 0
min := 2 ^ 31 # good enough ...
while length := *read() do {
max <:= length
min >:= length
}
write(min)
write(max)
end