求各位大虾大神这个程序哪里有问题?
#include<stdio.h>#include<stdlib.h>
#include<string.h>
#include<windows.h>
int main()
{
FILE *fp;
char ch,select[100];
char typed_text[500];
char str[100];
int totallength,typedlength;
int correctnum=0;
int i=0,n=0,j=0;
char number;
long time1, time2;
printf("************************************\n");
printf("* welcome to words typing system *\n");
printf("* choose 1~5 *\n");
printf("************************************\n");
printf("************************************\n");
printf("Please input the order number of paper\n");
scanf("%c", &number);
switch(number)
{
case'1': strcpy(select, "E:\\document\\5_1.txt");break;
case'2': strcpy(select, "E:\\document\\5_2.txt");break;
case'3': strcpy(select, "E:\\document\\5_3.txt");break;
case'4': strcpy(select, "E:\\document\\5_4.txt");break;
case'5': strcpy(select, "E:\\document\\5_5.txt");break;
default: printf("error option\n");break;
}
fp=fopen(select,"r+");
if(fp==NULL)
{printf("open error\n");exit(1);}
while((str[i]=fgetc(fp))!=EOF)
{ putchar(str[i]);
i++;
}
printf("\n");
n=i;
printf("now start our game!\n");
time1=GetTickCount();
gets(typed_text);
for(j=0;j<n;j++)
{if(typed_text[j]==str[j])
correctnum++;
}
time2=GetTickCount();
totallength=strlen(str);
typedlength=strlen(typed_text);
printf("Your accuracy is %.2f%%, and your speed is %d per minute!\n",correctnum*100/totallength,
(typedlength*1000*60)/(time2-time1));
printf("test\n");
return 0;
}