头文件:
两者头文件如下:
#include<windows.h>
system:
public int _cdecl system (const char *_command)
system有三种用法。
system("cls")
效果为清屏。
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<windows.h>//system()函数需要
using namespace std;
int main(){
for(int i=1;i<=8;i++){
cout<<"!@#$%^&*()!@#$%^&*()……%¥¥##…………("<<endl;
}//输出乱码
cout<<"是否清屏(是1,不是0):";//询问
int a;
cin>>a;//是否清屏
if(a==1){
system("cls");
}//清屏判断
return 0;