其中头文件"key.h"内容见文章最后部分 #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <malloc.h> #include <time.h> #include <math.h> #include <bios.h> #include <dir.h> #include "key.h" typedef struct TEXE { unsigned char ch; unsigned char attr; }Text; typedef struct { char name[25]; float sco; }record; int score[6]={0}; int key,myscore=0; int right=0,wrong=0,last; double RightRate=1.0,speed=0.0; struct ffblk ffblk; time_t StartTime,LeftTime; void Main_menu(); void Start_test(); void Type_test(char*s); void End_test(); void Print_score(); void Get_time(char*); void Manager_paper(); void Edit_paper(); void Score_list(); void texte(char *str); int main() { Main_menu(); return 0; } void Main_menu() { textmode(C80); textbackground(WHITE); clrscr(); window(6,3,75,23); textbackground(BLACK); textcolor(WHITE); clrscr(); gotoxy(20,3); printf("Welcome To XXX Typing Test "); gotoxy(27,6); printf("Main Menu"); gotoxy(24,8); printf("1 Typing Text "); gotoxy(24,10); printf("2 High Scores"); gotoxy(24,12); printf("3 Edit Text Yourself "); gotoxy(24,14); printf("4 Exit Test"); gotoxy(24,16); printf("Please press 1,2,3or4:"); gotoxy(22,18); cprintf(" CopyRight(c) 2008 XXX"); gotoxy(46,16); switch(getch()) { case'1': { Start_test(); break; } case'2': { Score_list(); break; } case'3': { Manager_paper(); break; } case'4': { exit(0); } default: Main_menu(); } } void Start_test() { char str[][20]={"test1.txt","test2.txt","test3.txt","test4.txt"}; FILE *fp; textmode(C80); textbackground(WHITE); clrscr(); window(6,4,75,22); textbackground(BLACK); textcolor(WHITE); clrscr(); gotoxy(20,5); printf("Choose One Test "); gotoxy(20,7); printf("1 1.txt"); gotoxy(20,9); printf("2 2.txt"); gotoxy(20,11); printf("3 3.txt"); gotoxy(20,13); printf("4 4.txt"); gotoxy(20,15); printf("Choose The Test:"); while(1) { switch(getch()) { case '1': {Type_test(str[0]);break;} cas
打字测试程序代码(C语言)
最新推荐文章于 2022-12-27 14:45:38 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)