home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
349_01
/
sss.arc
/
EX_0301.C
< prev
next >
Wrap
Text File
|
1991-04-09
|
628b
|
42 lines
/* Program EX_0301.C
Listing 4C - see documentation in TUTOR.SSS
*/
#include "SSSC.H"
#define free 0
#define busy 1
double rnx(double m, double s)
{
double x;
do x = RN(m, s);
while (x <= 0.0);
return(x);
}
void prime(void)
{
INIQUE(0, 0, 1);
INISTA(1, "Busy fraction", 1, 0, 0, 0);
TALLY(1, free);
SETT(rnx(7, 4));
TALLY(1, busy);
}
main()
{
prime();
do
{
if (RA() < .25) SETT(T()+ER(2, 2));
else SETT(T()+TR(1, 3, 4));
TALLY(1, free);
SETT(T()+rnx(7, 4));
TALLY(1, busy);
} while (T() <= 120);
SUMRY("");
}