include<conio.h>int main(){int i=0;char c;while(1){c='\0';while(c!=13&&c!=27){c=getch();printf(“%c\n”,c);}if(c==27)break;i++;printf(“the one is %d\n”,i);}printf(“the end”);}
当输入的字符的ascii码值等于27时就退出循环