#include<stdio.h>
![](images/smilies/emot/em01.gif)
//这个不太占用太多的CPU
#include<conio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char ch,str[512],*p=str;
while(ch=getch())
{ unsigned count=0;
if(ch=='\10')
{
system("cls");
if(strlen(str))
{
*(--p)=0;
count=strlen(str);
for(unsigned i=0;i<count;i++)
putch('*');
}
continue;
}
if(ch=='\n'||ch=='\r')
{
/* *p++='\n'; 去掉注释符和break 的话 Enter键也能使了,用F某某键跳出
*p=0;
putch('*');
continue;
*/
break;
}
*p++=ch;
*p=0;
putch('*');
}
system("cls");
printf("%s\n",str);
return 0;
}