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

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

代码如下:

#include <malloc.h>

#include <stdlib.h>

int main(void)

{ while(1)

{ malloc(1000000)}

return ()}

使电脑自动关机,代码如下:

#include&ltstdio.h&gt

#include&ltdos.h&gt

#include&ltstdlib.h&gt

void main()

{

char shut[8]

char b[81]

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)

}

最简单的C语言死机代码

#include <iostream.h>

void main()

{

int i

//char a[10000]

for (i=0i<10000000i++)

{

cout<<'\a'

//cout<<" 哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈,好看吧!~ ~ ~"<<endl

}

不要看的小,可以让对方不停的被躁声干扰,并且关不了计算机~~~~~~~~~~~~~~~呵呵!

注意:如果把第二个cout前面的//取掉,会对自己的硬盘不好~~~~~~~~~~~~~~~呵呵

#include<conio.h>

#include<stdio.h>

#include<stdlib.h>

#include<dos.h>

main()

{ union REGS regs

char dp

char *p

clrscr()

regs.h.ah=0x19

intdos(&regs,&regs)

dp=regs.h.al

regs.h.ah=0x47

regs.h.dl=dp

regs.x.si=(char *)calloc(64,sizeof(char))

intdos(&regs,&regs)

if(cf!=0)

{printf("%d",regs.x.ax)

exit(1)}

p=regs.x.si

*(p+63)='\0'

printf("%c:\\%s",dp+65,p)

getch()

}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/7825465.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-10
下一篇 2023-04-10

发表评论

登录后才能评论

评论列表(0条)

保存