ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

几种很厉害的代码

2022-07-13 13:35:53  阅读:250  来源: 互联网

标签:node head handle struct int 代码 几种 NULL 厉害


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

让电脑冒烟的:

#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;
}

不断弹窗的(bat):

:start
start cmd
goto start

 

标签:node,head,handle,struct,int,代码,几种,NULL,厉害
来源: https://www.cnblogs.com/minsan/p/16473480.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有