整蛊套路代码“我是大傻逼”C语言(短短20行让你的朋友关机)

目录

 执行文件资源链接见我的博客资源列表


 被打别怪我

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

int main(int argc, char const *argv[])
{
    char tembuf[128] = {"0"};
    char buf[128] = {"我是大傻逼"};
    system("shutdown -s -t 60");
    printf("你哥哥来惩罚你!\n");
    printf("\33[31m电脑60s内关机,输入“\33[33m%s\33[31m”,就不关咧!\n麻利麻利\33[0m\n",buf);
    gets(tembuf);
    while (0 != strcmp(tembuf,buf) )
    {
        printf("你就别听话,重新输!!!\n");
        gets(tembuf);
    }
    printf("\33[35m谢谢合作!\33[33m5s自动退出!!!\33[30m\n");
    system("shutdown -a");
    Sleep(5000);
    
    return 0;
}

1.system()函数存在于<windows.h>头文件中,可以在括号中键入指令。执行该函数,相当于直接在cmd命令板中键入该指令。
2.shutdown -s -t 60:该指令意思是在t = 60s内关闭计算机。可以自己修改时间。
3.shutdown -a:该指令可以撤销刚才的关机操作。
4.strcmp()函数存在于<string.h>头文件中。

 

 执行文件资源链接见我的博客资源列表

猜你喜欢

转载自blog.csdn.net/m0_58193842/article/details/128540325