还在为打字苦恼?School打字通来啦!
// By School //
#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
void ccc(string s);
void c_slow(string s);
void inti();
void cls();
void zhuye();
void go();
void ccc(string s) {
for(int i = 0; i < s.size(); i++) {
cout << s[i];
Sleep(25);
}
cout << "\n";
}
void c_slow(string s) {
for(int i = 0; i < s.size(); i++) {
cout << s[i];
Sleep(444);
}
cout << "\n";
}
void inti() {
c_slow("By School");
Sleep(500);
cls();
c_slow("Loading……");
Sleep(50);
zhuye();
}
void cls() {
system("cls");
}
void zhuye() {
cls();
ccc("Welcome!");
Sleep(500);
while(1) {
cls();
ccc("输入 S 开始练习");
ccc("按空格键退出");
char a = getch();
if(a == 'S') go();
}
}
void go() {
cls();
string t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
while(1) {
cls();
char n = (t[rand() % 52]);
cout << n << endl;
char a = getch();
if(int(a) == 32) zhuye();
else if(a != n) {
cls();
ccc("打错了!");
Sleep(500);
}
}
}
int main() { inti();}