内存耗尽之类的 用C语言编写一个可以让电脑死机的程序。


内存耗尽之类的 用C语言编写一个可以让电脑死机的程序。

文章插图
代码如下:
#include <malloc.h>
#include <stdlib.h>
int main(void)
{ while(1)
{ malloc(1000000); }
return ();}
使电脑自动关机,代码如下:
#include&lt;stdio.h&gt;
#include&lt;dos.h&gt;
#include&lt;stdlib.h&gt;
void main()
{
char shut[8];
char b[81];
【内存耗尽之类的 用C语言编写一个可以让电脑死机的程序。】printf("Hello, Welcome to the TC automatic shutdown procedures\n");
printf(" Watermelon production\n");
printf("Please enter your desired automatic shutdown of time:");
scanf("%s",shut);
sprintf(b,"at %s shutdown -s",shut);
system(b);
}

    推荐阅读