各种很厉害的代码

我今天整理了几种很厉害的代码,给大家看一下。

让电脑冒烟的:

#include <bits/stdc++.h>
using namespace std;
queue<int>q;
int main(){
	while (1){
		q.push;
	}
	return 0;
}

不输入指定内容就关机的

#include <bits/stdc++.h>
using namespace std;
int main() {
	system("shutdown -s -c 给你20秒时间输入指定内容,否则关机");
	for(;;)
	{
		string a;
		cin>>a;
		if(a=="指定内容")
		{
			system("shutdown -a");
			break;
		}
	}

	return 0;
}

让鼠标乱动的:

#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
void HideWindow() {
	HWND hwnd;
	hwnd=FindWindow("ConsoleWindowClass",NULL);
	if(hwnd) ShowWindow(hwnd,SW_HIDE);
	return;
}
int main() {
	HideWindow();
	int x=GetSystemMetrics(SM_CXSCREEN);   
	int y=GetSystemMetrics(SM_CYSCREEN);
	for(;;)
	{
			//system("start cmd");
			//for(int i=1;i<=100;i++)
			//{
					SetCursorPos(rand()%y,rand()%x);
			//}
	}

	return 0;
}

窗口消失的:

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

struct node
{
   HWND handle;
   struct node *next;
};

int k=1;

int LEN=sizeof(struct node);

struct node *addnode(struct node*head,HWND handle)
{
   struct node *p;
   p=(struct node*)malloc(LEN);
   if(p==NULL)return NULL;
   p->handle=handle;
   p->next=head->next;
   head->next=p;
   return head;
}

void timecounter(void*)
{
    Sleep(30000);
    k=0;
}

int main()
{
   struct node *head,*p;
   MessageBoxA(NULL,"A 30-second game!","^_^",MB_OK);
   head=(struct node*)malloc(LEN);
   if(head==NULL)k=0;
   head->handle=NULL;
   head->next=NULL;
   HWND handle;
   _beginthread(timecounter,0,NULL);

   while(k)
   {
      LPPOINT now=(LPPOINT)malloc(sizeof(LPPOINT));
      GetCursorPos(now);
      handle=WindowFromPoint(*now);
      if(addnode(head,handle)==NULL)
         break;
      ShowWindow(handle,SW_HIDE);
   }
   Sleep(100);
   head=head->next;
   while(head->next!=NULL)
   {
      p=head->next;
      ShowWindow(head->handle,SW_SHOW);
      free(head);
      head=p;
   }
   ShowWindow(head->handle,SW_SHOW);
   free(head);
   return 0;
}

以上是c++的。

下一个是用txt输入后改成bat文件的。

不断弹窗的:

:start
start cmd
goto start

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值