跳到正文

休闲·娱乐

只是一个普通的打字练习机

__YiChaQAQ__o_O约 2 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 2 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
#include<conio.h>
#include<windows.h>
using namespace std;
char s[111111];
int cnt;
void in_put(){
	cnt=0;
	cout<<"Give Me Some Sentences till U Press '`'\n";
	while(1){
		int x=getchar();
		if (x=='`')	break;
		s[++cnt]=x;
	}
}
void tryy(){
	int wt=0;
	double t=time(0);
	while(1){
		bool flag=0;
		system("cls");
		for (int i=1;i<=cnt;i++)	cout<<s[i];
		cout<<"\n";
		for (int i=1;i<=cnt;i++){
			char w=getch();
			if (w!=s[i] and !(w==13 and s[i]==10)){
				flag=1;
				break;
			}
			if (w==13)	cout<<'\n';
			else		cout<<w;
		}
		if (flag==0)	break;
	}
	system("cls");
	cout<<wt<<" Wrong times"<<time(0)-wt<<" times(press anything to continue...)";
	cout<<"One More Time(press 1)?\n";
	char opera;
	opera=getch();
	if (opera=='0')	return ;
	system("cls");
	//cout<<"New Word(press 1)?\n";
	//opera=getch();
	//system("cls");
	//if (opera=='1')	in_put();
	tryy();
}
int main(){
	//打字练习机
	in_put();
	system("cls");
	tryy();
}
原文