恶搞小程序--定时关机

纯属娱乐

#include<stdio.h>
#include<windows.h>
#include<string.h>

int
main(int argc, char *argv[])
{
    unsigned char cnt = 3;

    system("shutdown -s -t 180");

    while (1) {
        printf("请输入取消关机的口令(口令:我是猪)\n");

        char input_buf[20] = "\0";

        gets(input_buf);

        if (cnt > 1) {
            if (strcmp(input_buf, "我是猪") == 0) {
                system("shutdown -a");
                printf("呵呵,取消关机成功,你确实是猪!\n");
                break;
            } else {
                cnt--;
                printf("取消关机失败,你还有%d次机会\n",cnt);
            }
        } else {
            printf("挺倔强啊,3次机会已经使用完了,等着关机吧!!!!\n");
            break;
        }
    }

    system("pause");

    return 0;
}

破解方法: 正确输入:我是猪

资源下载:https://download.csdn.net/download/tyustli/10901088

猜你喜欢

转载自blog.csdn.net/tyustli/article/details/86000603