为什么按Esc键无法退出程序?
#include<stdio.h>main()
{char c;
float Mass, G,radian,n,m; /*G unbalance grade.*/
{
do
{printf("Please input the value of rotor mass\n");
scanf("%f",&Mass);
printf("Please input the value of the radius of the rotor\n");
scanf("%f",&radian);
printf("Please input the value of the G\n");
scanf("%f",&G);
printf("Please input the value of the service speed\n");
scanf("%f",&n);
m=(9549*Mass*G)/(radian*n);
printf("The result is %f\n\n\n",m);
system("pause");
}
while((c=getchar())!='\033');
}
}
按Esc键后出现"\",但是无法退出程序。
如果把 while((c=getchar())!='\033');换成 while((c=getchar())!='\046');
按&键就能退出程序。
请各位指点啊!!
[ 本帖最后由 feixiangbccn 于 2012-2-5 17:07 编辑 ]