1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <stdio.h> #include <time.h> #include "queue.h" void main() { printf("input string > "); int c; while (can_enq() && (c = getchar()) != EOF && c != '\n') enq(c); int t1 = clock(), t2; while (can_deq()) { t2 = clock(); if ((t2 - t1) < (CLOCKS_PER_SEC / 3)) continue; t1 = t2; putchar(deq()); putchar('\n'); } }