1.暂停pause
用处:等待用户按下任意键后继续执行。
例
#include <bits/stdc++.h>
using namespace std;
int main()
{
cout<<"猴子爱吃RPG"<<endl;
system("pause");
cout<<"最帅!!!";
return 0;
}
运行结果:
2.调整颜色color
用处:调整控制器的背景颜色和字体颜色。
具体颜色对应表格:
例:
#include <bits/stdc++.h>
using namespace std;
int main()
{
system("color 3F");//3表示背景为淡绿色,F表示字体为亮白色
cout<<"猴子爱吃RPG最帅!!!";
return 0;
}
运行结果:
3.清屏cls
用处:清除执行器上的所有文字。
例:
#include <bits/stdc++.h>
using namespace std;
int main()
{
cout<<"猴子爱吃RPG……"<<endl;
system("pause");
system("cls");
cout<<"最衰!!!";
return 0;
}
运行结果:
……
4.日期与时间date/t,time/t
用处:输出当前日期或时间
例:
#include <bits/stdc++.h>
using namespace std;
int main()
{
system("time/t");
system("date/t");
return 0;
}
运行结果:
(电脑显示)
(执行器显示)
5.设置control(独门秘籍)
用处:用C++召唤出控制面板
#include <bits/stdc++.h>
using namespace std;
int main()
{
system("control");
return 0;
}
运行结果:
6.关机shutdown
用处:让电脑重启/关机/睡眠……
例:………………(无法提供实例)