#include		flp1_stdio_h

#define		NOCCARGC
#define		TRUE		1
#define		FALSE		0
#define		SIZE		8190
#define		FSIZE		8191

int	i, prime, k, count, iter;


main()	{
	char	str[10];
	int	flags[FSIZE];
	fputs("Press a key to start", stderr);
	curson(stdin); getchar(); cursoff(stdin);
	puts("\n\n10 iterations\n");
	iter=1;
	while (iter <= 10) {
		count = 0;
		i = 0;
		while (i <= SIZE) flags[i++] = TRUE;
		i = 0;
		while (i <= SIZE) {
			if (flags[i] != FALSE) {
				prime = i + i + 3;
				k = i + prime;
				while (k <= SIZE) {
					flags[k] = FALSE;
					k += prime;
					}
				count++;
				}
			i++;
			}
		iter++;
		}
	itoa(count, str);
	fputs("Number of primes: ", stderr);
	puts(str);
	}

_banner() {
	puts("\n Sieve of Eratosthenes benchmark\n\n");
	if (dataspace() < (2*FSIZE+100)) {
		puts("Not enough dataspace, use -s20000 switch\n");
		abort(1);
		}
	}

