打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
代码自动机(攻 ACwing 限时题)
#include<bits/stdc  .h>#include<windows.h>using namespace std;int tot=0;void an(int a){    keybd_event(a,0,0,0);    keybd_event(a,0,KEYEVENTF_KEYUP,0);}void dx1(){    keybd_event(16,0,0,0);}void dx2(){    keybd_event(16,0,KEYEVENTF_KEYUP,0);}bool f=1;int main(){    freopen("b.in","r",stdin);    char t;    for(int i=5;i>=0;i--)    {        cout<<i<<endl;        Sleep(1000);    }    while(1)    {        keybd_event(46,0,0,0);        keybd_event(46,0,KEYEVENTF_KEYUP,0);        system("cls");        t=getchar();        if(t==10)        {            an(13);            for(int i=1;i<=300;i  )            {                keybd_event(46,0,0,0);                keybd_event(46,0,KEYEVENTF_KEYUP,0);               }            f=0;            continue;        }        else if(t==' '&&f==1)        {            an(32);            f=0;            continue;        }        f=1;        if(t>='a'&&t<='z')            an(int(t)-32);        else if(t>='A'&&t<='Z')        {            dx1();            an(int(t));            dx2();        }        else if(t>='0'&&t<='9')            an(int(t));        else if(t=='~'||t=='!'||t=='@'||t=='#'||t=='$'||t=='%'||t=='^'||t=='&'||t=='*'||t=='('||t==')'||t=='_'||t==' '||t=='{'||t=='}'||t=='|'||t==':'||t=='"'||t=='?'||t=='<'||t=='>')        {            dx1();            if(t=='~')                an(192);            else if(t=='!')                an(49);            else if(t=='@')                an(50);            else if(t=='#')                an(51);            else if(t=='$')                an(52);            else if(t=='%')                an(53);            else if(t=='^')                an(54);            else if(t=='&')                an(55);            else if(t=='*')                an(56);            else if(t=='(')//****************************            {                an(57);                an(46);            }            else if(t==')')                an(48);            else if(t=='_')                an(189);            else if(t==' ')                an(187);            else if(t=='{')                an(219);            else if(t=='}')                an(221);            else if(t=='|')                an(220);            else if(t==':')                an(186);            else if(t=='"')//***********            {                an(222);                an(46);            }            else if(t=='?')                an(191);            else if(t=='<')            {                an(188);                an(46);            }            else if(t=='>')            {                an(190);            }            dx2();        }        else        {            if(t=='`')                an(192);            else if(t=='-')                an(189);            else if(t=='=')                an(187);            else if(t=='[')//************            {                an(219);                an(46);            }            else if(t==']')                an(221);            else if(t=='\\')                an(220);            else if(t==';')                an(186);            else if(t=='\'')//************            {                an(222);                an(46);            }            else if(t=='/')                an(191);            else if(t==',')            {                an(188);            }            else if(t=='.')            {                an(190);            }        }    }}
来源:https://www.icode9.com/content-4-591351.html
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
C# keybd
发现:Hook住一个key的消息,用keybd_event模拟键盘 - mY aSp.ne...
delphi窗体固定在桌面上
远程控制之鼠标、按键模拟
C#实现的三种方式实现模拟键盘按键
delphi模拟按键实现粘贴快捷键ctrl V
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服