给你一个变态的方法
#include <stdio.h>
system("cls");
变态吧?
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
// 清屏
{
for (int i=0; i<1000; ++i)
cout << i;
system("cls");
return 0;
}
函数名: clrscr <conio.h>
功 能: 清除文本模式窗口
用 法: void clrscr(void)
函数名: cleardevice
功 能: 清除图形屏幕
用 法: void far cleardevice(void)
举个例子吧。
#include<stdio.h>
#include <conio.h>
int main(void)
{
int i;
clrscr();
for (i = 0; i < 20; i++)
printf("%d\r\n", i);
printf("\r\nPress any key to clear screen");
getch();
clrscr();
printf("The screen has been cleared!");
getch();
return 0;
}
至于#include<conio.h>是放在#include<stdio.h>前还是后,无所谓的,习惯是之后。
温馨提示:内容为网友见解,仅供参考