简单的指法练习软件
用C语言编程的思路

程序代码:
#include <stdio.h>
#include <string.h>
int main()
{
char buffer[255] = {0};
char input[255] = {0};
int text_length, current_pos;
int i,j,k;
const char * TEXT = "A quick brown fox jumped over the lazy dog.";
text_length = strlen(TEXT);
current_pos = 0;
puts("/****************/");
puts("Simple type-player");
puts("Please input the same text below\n\n");
while(current_pos < text_length)
{
printf("\n%s\n", TEXT);
printf("%s", input);
fflush(stdout);
scanf("%[^\n]%*c", buffer);
fflush(stdin);
i = strlen(buffer);
k = current_pos;
for(j = 0; j < i; j++)
{
if(buffer[j] == TEXT[j + current_pos])
{
input[j+current_pos] = buffer[j];
k = j + current_pos;
}
}
input[k+1]='\0';
current_pos = k+1;
}
puts("\nRight!\n");
return 0;
}
