【求助】程序清屏时,不能完全清屏
#include <iostream.h>#include <stdlib.h>
void Menu();
void main()
{
char choose;
while(1)
{
Menu();
cin>>choose;
switch(choose)
{
case '1': exit(1);
default : cout<<"What you input is wrong!\n";
cout<<"You can only input the char '1'!\n";
break;
}
}
}
void Menu()
{
system("cls");
cout<<" ---------------------------------------\n";
cout<<" | Menu |\n";
cout<<" | 1.Exit |\n";
cout<<" ---------------------------------------\n";
cout<<" Please choose :";
}
当我输入'h'并回车时,"What you input is wrong!","You can only input the char '1'!";j竟然出现在 Menu 的上面,这是为什么? 语句system("cls");不是已经清屏了吗?
请高手指点!