#!/bin/sh # This is a shar archive. # The rest of this file is a shell script which will extract: # # 4_16.c 4_16a.c 4_16a2.c 4_16b.c 4_16c.c 4_16d.c 4_16e.c 4_16f.c 4_16g.c 4_16h.c 4_16i.c 4_16j.c 4_16k.c 4_16l.c makefile # # To extract the files from this shell archive file simply # create a directory for this file, move the archive file # to it and enter the command # # sh filename # # The files will be extracted automatically. # Note: Do not use csh. # # Archive created: Mon Jul 30 23:00:37 EDT 1990 # echo x - 4_16.c sed 's/^X//' > 4_16.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ #define PI = 3.141593; #define MAX(a,b) a>b?a:b #define fac(a) (a)*fac((a)-1) !EOF! ls -l 4_16.c echo x - 4_16a.c sed 's/^X//' > 4_16a.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ #define PI 3.141593 !EOF! ls -l 4_16a.c echo x - 4_16a2.c sed 's/^X//' > 4_16a2.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ const double PI = 3.141593; !EOF! ls -l 4_16a2.c echo x - 4_16b.c sed 's/^X//' > 4_16b.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ #define MAX(a,b) ((a) > (b) ? (a) : (b)) !EOF! ls -l 4_16b.c echo x - 4_16c.c sed 's/^X//' > 4_16c.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ // a function version of the fac() // macro which determines factorials int fac(int a) { return (a > 1) ? a * fac(a-1) : 1; } !EOF! ls -l 4_16c.c echo x - 4_16d.c sed 's/^X//' > 4_16d.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ MAX(a=b,c+d) !EOF! ls -l 4_16d.c echo x - 4_16e.c sed 's/^X//' > 4_16e.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ a = b > c + d ? a = b : c + d !EOF! ls -l 4_16e.c echo x - 4_16f.c sed 's/^X//' > 4_16f.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ a = (( b > ( c + d )) ? ( a = b ) : ( c + d )) !EOF! ls -l 4_16f.c echo x - 4_16g.c sed 's/^X//' > 4_16g.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ (( a = b ) > ( c + d )) ? ( a = b ) : ( c + d ) !EOF! ls -l 4_16g.c echo x - 4_16h.c sed 's/^X//' > 4_16h.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ j + MAX(a,b) !EOF! ls -l 4_16h.c echo x - 4_16i.c sed 's/^X//' > 4_16i.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ j + a > b ? a : b !EOF! ls -l 4_16i.c echo x - 4_16j.c sed 's/^X//' > 4_16j.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ ((j + a) > b) ? a : b !EOF! ls -l 4_16j.c echo x - 4_16k.c sed 's/^X//' > 4_16k.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ j + ((a > b) ? a : b) !EOF! ls -l 4_16k.c echo x - 4_16l.c sed 's/^X//' > 4_16l.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ MAX(a++,b++) !EOF! ls -l 4_16l.c echo x - makefile sed 's/^X//' > makefile << '!EOF!' test: @echo tests done !EOF! ls -l makefile # The following exit is to ensure that extra garbage # after the end of the shar file will be ignored. exit 0