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
/
delta.icn
< prev
next >
Wrap
Text File
|
2000-07-29
|
772b
|
33 lines
############################################################################
#
# File: delta.icn
#
# Subject: Program to list differences between successive numbers
#
# Author: Ralph E. Griswold
#
# Date: January 22, 1999
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program reads a stream of numbers from standard input and write
# a stream of their first differences to standard output.
#
############################################################################
procedure main()
local i, j
i := read() | exit()
while j := read() do {
write(j - i)
i := j
}
end