测手速机
C++#include<bits/stdc++.h>
#include <stdlib.h>
#include <windows.h>
#include <iostream>
#include<bits/stdc++.h>
#include<bitset>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int main()
{
double cx,axc=0;
cx=rand()%8998;
cx=cx+1001;
cout<<"当背景变成白色的,按下空格键";
Sleep(1000);
Sleep(cx);
system("color F0");
for(int i=1;;i++)
{
Sleep(0.0001);
axc=axc+0.0000001;
if(KEY_DOWN(' '))
{
cout<<endl<<"你的反应速度(手速)为:";
printf("%.7lf",axc);
char asdad;
cin>>asdad;
return 0;
}
}
}