#include<stdio.h>#include<time.h>#include<conio.h>#define _getch() getch();#define MAX 100#define N 10typedefenum{false ,true} bool;typedefchar mystring[MAX];voidsequentialPrint(mystring s,int);intmain(){int i;int n;
mystring s;printf("Kiem tra giua ky 20192\n");printf("Nhap so chuoi (tu 1 den 10):");scanf("%d",&n);printf("Nhap lan luot cac chuoi\n");for(i=0;i<n;i++){printf("s[%d]=",i);scanf("%s",&s[i]);}sequentialPrint(s, n);}voidsequentialPrint(mystring s,int n){
clock_t beginTime, endTime;
clock_t period =500;int i =0;int c;
beginTime =clock();while(true){if(kbhit()){
c =getch();if(c ==27)break;elseif(c =='a'){if(period >100) period +=10;}elseif(c =='d')if(period <2000) period -=10;}
endTime =clock();if(endTime-beginTime>period){
beginTime = endTime;printf("%s ", s[i]);if(i==(n-1))printf("\n");
i =(i+1)% n;}}}