改进于 文宇炽筱_潜水
c++版的打字效果_c++自动打字-CSDN博客https://blog.csdn.net/2401_84159494/article/details/141023898?ops_request_misc=%257B%2522request%255Fid%2522%253A%25227f97863ddc9d1b2ae9526f45765b1744%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=7f97863ddc9d1b2ae9526f45765b1744&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-141023898-null-null.nonecase&utm_term=%E6%89%93%E5%AD%97&spm=1018.2226.3001.4450
#include<bits/stdc++.h>
#include<Windows.h>
#define quickly() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define Sc(a) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);
using namespace std;
int main(){
quickly();
string ts;
cin>>ts;
int a=ts.size();
for(int i=0;i<=a;i++){
Sc(15);
system("cls");
srand(time(0));
int p=rand()%10+1;
std::cout<<ts.substr(0, i)<<std::flush;
Sc(12);
cout<<"|"<<std::flush;
Sleep(p*50);
}Sc(15);
return 0;
}