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_0305.C < prev    next >
Text File  |  1991-04-09  |  532b  |  36 lines

  1. /* Program EX_0305.C
  2.    Listing 5C - see documnetation in TUTOR.SSS
  3. */
  4.  
  5. #include "SSSC.H"
  6.  
  7. int i, c;
  8.  
  9. void prime(void)
  10. {
  11.   INIQUE(0, 0, 2);
  12.   INISTA(1, "Out of stock", 0, 0, 0.0, 0.0);
  13.   INISTA(2, "Ave stock", 1, 0, 0.0, 0.0);
  14. }
  15.  
  16. main()
  17. {
  18.   prime();
  19.  
  20.   for (i=1; i<=3; i++)
  21.   {
  22.     c = 15;
  23.     SETT(30*(i-1));
  24.     TALLY(2, c);
  25.     SETT(T() + EX(2));
  26.     while (T() <= 30*i)
  27.     {
  28.       if (c > 0) c--; else TALLY(1, 1);
  29.       TALLY(2, c);
  30.       SETT(T() + EX(2));
  31.     }
  32.   }
  33.  
  34.   SUMRY("");
  35. }
  36.